If we can change the
appearance of elements
based on screen size, our problem is
solved. We can use media queries
to set different styles
for different sizes.
Let's look at an example first:
Resize the output panel in full screen mode and notice that there are 4 fixed layouts based on different screen sizes. Width of the body
, .left
and .main
are specified in pixels and changed based on screen width.
These are media queries:
The styles specified within this block are applied when the screen width is a minimum of 768px and a maximum of 1200px.
Such a layout is called an adaptive layout.