@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
/* Smartphones and larger (mobile-first) */
/* Tablet portrait and larger */
@media only screen and (min-width: 600px) {}
/* Tablet landscape and larger */
@media only screen and (min-width: 900px) {}
/* Desktop and larger */
@media only screen and (min-width: 1200px) {}
/* Big desktop (4k) */
@media only screen and (min-width: 2500px) {}
@media only screen and (min-device-width: 900px) and (max-device-width: 1200px) {
/* insert styles here */
}
The @media rule is used in media queries to apply different styles for different media types/devices.
Media queries can be used to check many things, such as:
width and height of the viewport
width and height of the device
orientation (is the tablet/phone in landscape or portrait mode?)
resolutio
@media screen and (max-width: 480px) { }
Code Example |
---|
Css :: how to divide flex space equally |
Css :: css id selector |
Css :: css display flex white-space: nowrap; |
Css :: variable in scss |
Css :: css 16 9 ratio |
Css :: css ripple effect |
Css :: make image scale based on screen size |
Css :: css animation |
Css :: css grid |
Css :: background image causes webpage scrolling slow |
Css :: NeuMorphisme button code |
Css :: animation not hover out |
Css :: ms-clear event |
Css :: css resize tabe cell |
Css :: what is display inline |
Css :: css padding 4 values |
Css :: values play state animation css |
Css :: css margin |
Css :: css efeito negativo fotos |
Css :: two shadows css |
Css :: scss import another file |
Css :: button with background image and text html css |
Css :: how to lighten the color of text in html |
Css :: :before css |
Css :: linear gradient farthest-corner code css |
Css :: css hide after seconds |
Css :: css properties |
Css :: css gradient |
Css :: corsair css |
Css :: css tutorial point |