• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

What are Media Queries?

Media queries let you customize styles based on the characteristics of the user’s device or display, such as the viewport width, whether it’s in portrait or landscape mode, or whether it shows color. This is different from the media types, such as screen and print, that you can specify for your style sheets in CSS 2.1. With media queries, you specify not only the media type to which you want to apply a set of styles, but also one or more characteristics of the user’s display. Here’s an example:

@media screen and (max-width: 600px) {
   body { 
      font-size: 88%; 
   }
   #content-main {
      float: none;
      width: 100%;
   }
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint