Announcement

Collapse
No announcement yet.

Where to insert media queries

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where to insert media queries

    Do I insert my media queries in my CSS.

    /* When the screen is less than 680 pixels wide, hide all list items, except for the first one ("Home"). Show the list item that contains the link to open and close the topnav (li.icon) */
    @media screen and (max-width:680px) {
    ul.topnav li:not(:first-child) {display: none;}
    ul.topnav li.icon {
    float: right;
    display: inline-block;
    }

    }

    /* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens */
    @media screen and (max-width:680px) {
    ul.topnav.responsive {position: relative;}
    ul.topnav.responsive li.icon {
    position: absolute;
    right: 0;
    top: 0;
    }
    ul.topnav.responsive li {
    float: none;
    display: inline;
    }
    ul.topnav.responsive li a {
    display: block;
    text-align: left;
    }

    }

  • #2
    Correct, you put the media queries in the CSS and any of the CSS within the queries will only be used then the specific criteria is matched.

    Comment


    • #3
      Solved, thank you very much.

      Comment

      Working...
      X