- Read Tutorial
- Watch Guide Video
Moving on, we'll style our footer now.
If you go the HTML file, you'll see there are two <div>
tag overlapping each other - one called "footer" and the other one "footer-links". We don't need both, so we can remove one.
If that's done, let's get on with our styling. For a sticky footer, we need to set the position
to absolute. To tell the browser that it needs to be right at the bottom, we have to give a value of zero to the bottom
attribute. Let's set the width and height to 1300px and 30px respectively, and we'll align the text to center.
#footer { position: absolute; bottom: 0; width: 1300px; height: 30px; text-align: center; }
This code will move our links to the bottom.
Next, we'll work on the links. Let's change the color to white, remove all text decoration, add a left margin and have a font size of 0.8em.
.footer-link { color: white; text-decoration: none; margin-left: 25px; font-size: .8em; }
Lastly, we'll work on the flag. We'll keep the width really small, and I want to it to stick up a little bit, so let's set a negative value to the bottom margin.
#flag { width: 20px; margin-bottom: -5px; }
This looks really neat, and all links including the flag are clickable.