Create responsive websites with CSS3 media query

Responsive web design (RWD) is an approach whereby a designer creates a web page that “responds to” or resizes itself depending on the type of device it is being seen through. That could be an over-sized desktop computer monitor, a laptop or devices with small screens such as smartphones and tablets. Media queries are used to detect and respond to device with variable device width.

We have 3 ways to use media query.

  1. @import Method import CSS files
  2. Writing media query in single CSS file
  3. including linked CSS

1. @import Method import CSS files

2. Writing media query in single CSS file

3. including linked CSS

Media queries for common device breakpoints