Project Solution: Styling the Footer of the Tesla Homepage
This solution guide examines how to integrate the styles for the Tesla homepage footer, including how to update the links styles to function like a secondary navigation bar located on the bottom of the page.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

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.

large

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.

large