On CSS Tricks, A Web Design Community created by Chris Coyier, a web developer and designer who also co-authored Digging into WordPress. Chris covers a number of aspects of media queries including:
The CSS media query syntax for calling an external stylesheet is like this:
The CSS media query attribute can be implemented directly inside a CSS file, like this:
Likewise, you can use more advanced CSS media queries like this to setconditional statements checking for browser window sizes:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media (min-width: 544px){ | |
/* Small "sm" Breakpoint */ | |
} | |
@media (min-width: 768px){ | |
/* Medium "md" Breakpoint */ | |
} | |
@media (min-width: 992px){ | |
/* Large "lg" Breakpoint */ | |
} | |
@media (min-width: 1200px){ | |
/* Extra Large "xl" Breakpoint */ | |
} | |
@media print { | |
/* All your print styles go here */ | |
} |
Resources:
CSS Tricks
Documentation
No comments:
Post a Comment