Learn Typography by Building a Nutrition Label - Step 43

Tell us what’s happening:

it says One span element should wrap the text Total Fat   but it doesn't work 

Your code so far

/* file: index.Ext.html */
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Nutrition Label</title>
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,800" rel="stylesheet">
  <link href="./styles.css" rel="stylesheet">
</head>

<body>
  <div class="label">
    <header>
      <h1 class="bold">Nutrition Facts</h1>
      <div class="divider"></div>
      <p>8 servings per container</p>
      <p class="bold">Serving size <span>2/3 cup (55g)</span></p>
    </header>
    <div class="divider large"></div>
    <div class="calories-info">
      <div class="left-container">
        <h2 class="bold small-text">Amount per serving</h2>
        <p>Calories</p>
      </div>
      <span>230</span>
    </div>
    <div class="divider medium"></div>
    <div class="daily-value
      small-text">
      <p class="bold right">% Daily Value *</p>
      <div class="divider">
       <p><span class="bold">Total Fat</span> <span>8g</span> <span class="bold">10%</span></p>
     </div>
       <p><span>Total Fat</span><span>8g</span><span>10%</span></p>
  </div>
</body>
</html>

Remove this span here

Add an opening span element

Then you have a duplicate text delete the second one

Happy coding

it doesn’t wotk i removed it the 8g text

Did you delete the extra p element below the div and added a span after the opening p element

like this

% Daily Value *

Total Fat10%

This two p elements are the same delete the second one

okay i updated it but now is says

You should create a new p element at the end of your .daily-value element.

% Daily Value *

can you paste you revised code

okay thanks
yeah it’s complicated here is my code

After your last .divider element, create a p element and give it the text Total Fat 8g 10%. Wrap the text Total Fat in a span element with the class of bold. Wrap the text 10% in another span element with the class of bold. Finally, nest the Total Fat span element and the text 8g in an additional span element for alignment.

Nutrition Label

Nutrition Facts

8 servings per container

Serving size 2/3 cup (55g)

Amount per serving

Calories

230

% Daily Value *y

Nutrition Label

Nutrition Facts

8 servings per container

Serving size 2/3 cup (55g)

Amount per serving

Calories

230

% Daily Value *y

I added spaces around all 3 texts and the code passed

<p><span><span> Total Fat </span> 8g </span><span> 10% </span></p>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.