question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Learn Typography by building a Nutrition Label:Step 22

See original GitHub issue

Describe the Issue

In this ,we have to add span tag in between p tags and if we give spacing between text present in p tags only then the test cases is accepted. This case will work:-

    //<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>
    //</div>

But This will not work:-

    // <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>
     //</div>

we can add a new test case which could allow the second one too or can add a description regarding it.

Affected Page

https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-typography-by-building-a-nutrition-label/step-22

Your code

 //<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>
     //</div>

Expected behavior

This should have been worked or we could actually tell the user to rectify the spacing

Screenshots

No response

System

  • Device: [e.g. iPhone 6, Laptop]
  • OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22] Laptop Windows 11 Brave

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:20 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
moT01commented, Aug 23, 2022

Alright, I’m going to open this up for help. We want to change the test so it allows a space at the start of that span, but keep the test for the paragraph so the whole sentence is correct. It’s the third test in this file

1reaction
hanswang123456commented, Aug 23, 2022

@moT01, removing the leading/trailing white space from the span assertion could be an option. That way, the test only has to confirm the correct text(leading/trailing space) and let the general p tag test handle any spacing issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[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...
Read more >
Learn Typography by Building a Nutrition Label | PLAYCODE
Learn Typography by Building a Nutrition Label. Step 1 ... Step 18. PRO. Step 19. PRO. Step 20. PRO. Step 21. PRO. Step...
Read more >
step 47 freecodecamp nutrition table - Code Grepper
Daily Value * Total Fat 8g10% Saturated Fat 1g 5%
Read more >
Guide to creating a front of pack (FoP) nutrition label for pre ...
This guidance provides a step-by-step guide through the process of creating a FoP label, with further advice and worked examples provided in the...
Read more >
Raj Pansuriya (@Raj_Pansuriya7) / Twitter
It was about learning typography by building a Nutrition Label. Understood significance of text-styling and got to use many new CSS rules and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found