Learn how to use media queries for common device breakpoints.
There are tons of screens and devices with different heights and widths, so it is hard to create an exact breakpoint for each device. To keep things simple you could target five common groups:
/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {...}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {...}
/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {...}
/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}
Try it Yourself »
CSS Tutorial: CSS Media Queries
CSS Tutorial: CSS Media Queries Examples
CSS Reference: The @media rule
RWD Tutorial: Responsive Web Design with Media Queries
JavaScript Tutorial: The window.matchMedia() method
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!