[Step 22]Learn Typography by Building a Nutrition Label

Tell us what’s happening:
Describe your issue in detail here.
I’m told to " Wrap the text 2/3 cup (55g) in a span element, and give it a class attribute set to right ."

I truly believe I’ve done the right thing but I keep getting the hint " Your .right element should have the text 2/3 cup (55g) ."

What am I doing wrong?

strong text
Your code so far

\ file: <!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">
    <h1 class="bold">Nutrition Facts</h1>
    <div class="divider"></div>
    <p>8 servings per container</p>
    
    <p class="bold">Serving size <span class="right" > 2/3 cup (55g) </span></p>
    
    </span>
  </div>
</body>
</html>

```css
\ file: * {
box-sizing: border-box;
}

html {
font-size: 16px;
}

body {
font-family: 'Open Sans', sans-serif;
}

.label {
border: 2px solid black;
width: 270px;
margin: 20px auto;
padding: 0 7px;
}

h1 {
text-align: center;
margin: -4px 0;
letter-spacing: 0.15px
}

p {
margin: 0;
}

.divider {
border-bottom: 1px solid #888989;
margin: 2px 0;
}

.bold {
font-weight: 800;
}
* {
box-sizing: border-box;
}

html {
font-size: 16px;
}

body {
font-family: 'Open Sans', sans-serif;
}

.label {
border: 2px solid black;
width: 270px;
margin: 20px auto;
padding: 0 7px;
}

h1 {
text-align: center;
margin: -4px 0;
letter-spacing: 0.15px
}

p {
margin: 0;
}

.divider {
border-bottom: 1px solid #888989;
margin: 2px 0;
}

.bold {
font-weight: 800;
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36

Challenge: Step 22

Link to the challenge:

1 Like

There is one </span> too many + remove unnecessary whitespaces and last refresh/restart if needed.

Thanks! I removed the extra span and some whitespaces but I still get the same error. Is my texted not wrapped properly by the .right element?

I just took your code and did as per above said. It worked. Maybe open a new window or browser?

Nah didn’t work, might be a bug then. Oh well thanks for helping!

restart step

and then simply follow along instructions and dont use anyother extra spacing in between, it should be fine

I encountered the same error when attempting to validate this line of code for this step.
I changed the whitespace multiple times to multiple combinations. The only way that I was able to overcome it was to change it to what is shown in this example. Any whitespace formatting other than what is shown in this example caused a validation error:
<p class="bold">Serving size <span class="right">2/3 cup (55g)</span></p>
The trick seems to be adding whitespace after the word size

Mod Edit: SOLUTION REMOVED

do like this

In order to maintain the paragraph in one line, you need to add a whitespace after “Serving size_” or else it will be attached to “2/3”.

That’s the solution and that’s why it works.

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