Learn Typography by Building a Nutrition Label - Step 43

Heyyyy can I get a hand ova here
I don’t see what im doing wrong. I even checked it in a validator and it says nothing wrong…

The supposed issue is only with this part of the code but if you want the entire code i can post it. Thanks!

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.

    <div class="daily-value small-text">
      <p class="bold right">% Daily Value *</p>
      <div class="divider"></div>
      <p><span class="bold">Total Fat</span><span>8g</span><span class="bold">10%</span></p>
    </div>
    ```

When I check the code it says

One span element should wrap the text Total Fat.

You need a span that goes around both total fat and 8g. Not a span that just goes around 8g. So remove the span you have that just goes around the 8g and add a span that starts before total fat span with the class of bold and ends right after 8g

So in total there should be 3? one for the 10%, one for the Total Fat and one for Total Fat and 8g?

Yes. Total fat and 10% get their own span. Then total fat and 8g share a span

Neither of these work… I think my braincells are failing me

<p>
<span>
<span class="bold">Total Fat</span>
8g</span>
<span class="bold">10%</span>
</p>
    </div>

second attempt:

   <p><span class="bold">
<span>Total Fat</span>
8g</span>
<span class="bold">10%</span></p>
    </div>

Can you share the entire html code

Sure thing!

<!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"></div>
      <p><span><span class="bold">Total Fat</span>8g</span><span class="bold">10%</span></p>
    </div>
    

add a space right here after the closing span and you should be good

1 Like

Maaaan! I tried space but it was in the wrong spot, haven’t thought of that! Thanks Biggs

1 Like

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