Using media queries to alter a design
If you've read and at least partially understood what we have been through so far in this chapter, you should be ready to start using media queries in earnest.
I'd suggest opening the index.html
file and the associated styles.css
file from the start
folder of this chapter's code. Then add some media queries to alter some areas of the page at certain viewport widths. Let's make a couple of changes together and then you can practice some of your own.
Let's look at the header section of what we have currently (viewport around 1200px wide):
Figure 3.3: At wider screens what we have in the browser doesn't match the designs
And here is the same section of the design we are building from:
Figure 3.4: The design calls for a different layout at wider viewports
We need to keep the design as it is for smaller viewports but amend it for larger ones. Let's start by adding...