CSS CSS Basics Basic Selectors ID and Class Selectors

ROBERT BUTLER
ROBERT BUTLER
2,008 Points

Give the header element a class attribute. Then, set the class value to main-header.

html and css

index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Developer Diane: Resume</title>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main>
    <header>
      <div>
        <h1>Developer Diane: Resume</h1>
        <address>
          <p>website: developerdiane.com</p>
          <p>email: diane@developerdiane.com</p>
        </address>
        <img src="developer-diane.jpg" alt="Developer Diane coding on her laptop.">
      </div>
    </header>          
    <section>
      <h2>Experience</h2>
      <ul>
        <li>
          <h3>Super Web Design Shop</h3>
          <p>Junior Developer</p>
          <p class="date special">February 2020-present</p>
        </li>
        <li>
          <h3>Pretty Good Websites, Inc.</h3>
          <p>Web Development Intern</p>
          <p>July 2019-January 2020</p>
        </li>
      </ul>
    </section>
    <footer>©2020 Developer Diane.</footer>
  </main>
</body>
</html>
style.css
/* Complete the challenge by writing CSS below */
p { /* "p" is class attribute */
  header: main-header
  }  

1 Answer

ROBERT BUTLER
ROBERT BUTLER
2,008 Points

Not sure. I keep getting the bummer answer for it.

melissamyra
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
melissamyra
Front End Web Development Techdegree Graduate 18,605 Points

So what it's asking here is for you to add the class attribute to the header element. Adding and altering attributes require you to alter the HTML file, you can't do that in CSS.

Remember CSS is mainly for altering how the HTML code will look like, so visual things like color, sizing, etc. And altering the actual document text, or categorizing elements (like giving them classes or ID) is all in HTML.

So basically in <header>, adding the 'class' attribute with value "main-header":

<header class="main-header">

Hope this helps.