Build a Tribute Page: CSS on the example webpage

In the CSS of the example webpage:

  font-family:"Trebuchet MS", Helvetica, sans-serif;

why apply the same style for both the html and body elements?

1 Like
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <link href='' rel='stylesheet' type='text/css'>
    html {
          font-size: 10px;
          font-family: 'Open Sans', sans-serif;
          background-color: #00539F;
    h1 {
          font-size: 60px;
          text-align: center;
    p, li {
          font-size: 16px;  
          line-height: 2;
          letter-spacing: 1px;
    body {
          width: 600px;
          margin: 0 auto;
          background-color: #FF9500;
          padding: 0 20px 20px 20px;
          border: 5px solid black;
    h1 {
          margin: 0;
          padding: 20px 0;  
          color: #00539F;
          text-shadow: 3px 3px 1px black;
    img {
          display: block;
          margin: 0 auto;
   <h1>Mozilla is cool</h1>
    <img src="" alt="The Firefox logo: a flaming fox surrounding the Earth.">

    <p>At Mozilla, we’re a global community of</p>
    <ul> <!-- changed to list in the tutorial -->

    <p>working together to keep the Internet alive and accessible, so people worldwide can be informed contributors and creators of the Web. We believe this act of human collaboration across an open platform is essential to individual growth and our collective future.</p>

    <p>Read the <a href="">Mozilla Manifesto</a> to learn even more about the values and principles that guide the pursuit of our mission.</p>


:grinning: A good example that will solve your doubts, about html and body. Luck!!

1 Like

I understand you can, for example, set different background colors for the html and the body, but why apply the same style to both, like in the tribute page example? Doesn’t the body element inherit all the styles from the html element anyway?

Everything except min-width does get inherited by the body in this case.

If you look up the CSS property you can see which are inherited and which are not (on MDN it is usually below the Specifications Section at the bottom of the page).

You can also force the child to inherit using the inherit keyword.

body {
  min-width: inherit;