Media Query

Divide CSS in blocks to operate according to screen size (width and height)

Base

@media screen and (max-width: 768px) {
/* Code for screens with up to 768px of width */
}

!Important

Prioritize properties

* {
background-color: white;
}

@media screen and (max-width: 768px) {
background-color: red; /* Won't be applied */
background-color: blue !important;
}

HTML Link

Separate mobile and desktop CSS sources.

<link rel="stylesheet" src="style.css">
<link rel="stylesheet" src="mobile.css" media="screen and (max-width: 768px)">

Mobile First

To follow a mobile first approach, it is recommended to code CSS to work in a mobile phone as default and make a post stylization for desktop.

/* CSS For Mobile */

@media screen and (min-width: 768px) {
/* CSS For Desktop */
}