// This applies from 0px to 600px
body {
background: red;
}
// This applies from 600px onwards
@media (min-width: 600px) {
body {
background: green;
}
}
// This applies from 600px onwards
body { green;
}
// This applies from 0px to 600px
@media (max-width: 600px) { red;
}
}
.content {
// Properties for smaller screens.
// Nothing is required here because we can use the default styles
// Properties for larger screens
@media (min-width: 800px) {
float: left;
width: 60%;
}
}
// Properties for larger screens.
float: left;
width: 60%;
// Properties for smaller screens.
// Note that we have to write two default properties to make the layout work
@media (max-width: 800px) {
float: none; 100%;
}
}
.gallery__item {
float: 33.33%;
@media (min-width: 800px) {
width: 25%;
}
}
30%;
margin-right 5%;
margin-bottom: 5%;
}
5%;
&:nth-child(3n) {
margin-right: 0;
}
}
@media (min-width: 800px) { 21.25%; // (100% - 15%) / 4
&:nth-child (4n) {
margin-right: 0;
}
}
}
// ...
@media (min-width: 800px) {
// ...
&:nth-child (3n) {
margin-right: 5%;
}
&:nth-child(4n) {
margin-right: 0%;
}
}
}
margin-right:
margin-bottom:
@media (max-width: 800px) {
width: 30%;
&:nth-child(3n) {
margin-right: 0;
}
}
@media (min-width: 800px) {
}
}
&:
}
// combining both min-width and max-width queries
@media (min-width: 800px) and (max-width: 1200px) {
}
@media (min-width: 1200px){ 16%; // (100% - 20%) / 5
&:nth-child (5n) {
margin-right: 0;
}
}
}