css screen size code example
Example 1: media query
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
Example 2: css media query
@media (min-width: 576px) {
.selector {
background-color:#f00;
}
}
@media (min-width: 768px) {}
@media (min-width: 992px) {}
@media (min-width: 1200px) {}
Example 3: width in % of a screen css
1vw = 1% of viewport width
1vh = 1% of viewport height
Example 4: media query
@media (max-height : 800px){
p{
font-size:10px
}
}
Example 5: screen sizes for css media
<meta name="viewport" content="width=device-width, initial-scale=1" />