Trying to make some CSS changes, that will only affect view on mobile phones. I made changes below, but it also affects desktop views.

nav {
    margin-top: 140px;


ownmenu {
    background-color: white;

closed as off-topic by Otto, Jacob Peattie, Dave Romsey, cjbj, Jack Johansson Oct 18 at 0:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

Try media query like

@media only screen and (max-width: 768px) {
    /* For mobile phones: */

Hope it will help!

  • worked perfectly. thank you Pratik – Joe Oct 12 at 11:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.