What is a Media Query?

Media Queries is a CSS3 module allowing content rendering to adapt to conditions such as screen resolution (e.g. smartphone screen vs. computer screen). It became a W3C recommended standard in June 2012, and is a cornerstone technology of Responsive web design.
It uses the @media rule to include a block of CSS properties only if a certain condition is true.

If the browser window is smaller than 500px, the css code executed within the bracket.
@media screen and (max-width:500px) { ... }

A media type can be declared in the head of an HTML document using the "media" attribute inside of a <link> element.

No comments:

Post a Comment