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.

Incorrect answer passes test for Set the font-size for Multiple Heading Elements challenge

See original GitHub issue

I was assisting a camper on the forum and found out that incorrect answers are allowed to pass the test. https://forum.freecodecamp.org/t/simple-font-size-code-problem-according-to-fcc-test/474829 I modified the campers code and this still passes even though it is incorrect.

<style>
<h1 style="font-size: 68px">This is h1 text</h1>
<h2 style="font-size: 52px">This is h2 text</h2>
<h3 style="font-size: 40px">This is h3 text</h3>
<h4 style="font-size: 32px">This is h4 text</h4>
<h5 style="font-size: 21px">This is h5 text</h5>
h6 {
  font-size:14px;
}
</style>
<h1 style="font-size: 68px">This is h1 text</h1>
<h2 style="font-size: 52px">This is h2 text</h2>
<h3 style="font-size: 40px">This is h3 text</h3>
<h4 style="font-size: 32px">This is h4 text</h4>
<h5 style="font-size: 21px">This is h5 text</h5>
<h6 style="font-size: 14px">This is h6 text</h6>

All of those headings in the style tags are supposed to be in the correct css format. But it looks like the test will just accept one of them in the correct format. The challenge is supposed to focus on just the style tags. Not inline. I think only the correct answer should be accepted.

Affected page

https://www.freecodecamp.org/learn/responsive-web-design/applied-visual-design/set-the-font-size-for-multiple-heading-elements

Correct code

This should be the only acceptable answer for this challenge.

<style>
  h1 {
    font-size: 68px;
  }

  h2 {
    font-size: 52px
  }

  h3 {
    font-size: 40px;
  }

  h4 {
    font-size: 32px;
  }

  h5 {
    font-size: 21px;
  }

  h6 {
    font-size: 14px;
  }
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>

System

  • Device: [e.g. iPhone6, Laptop]
  • OS: [e.g. iOS 14, Windows 10, Ubuntu 20.4]
  • Browser: [e.g. chrome, safari]
  • Version: [e.g. 22]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Nirajn2311commented, Aug 22, 2021

Yes, we need another test to check if the user has used inline styles or not. Since jquery has been used check the heading font-size, I think we can go with a jquery solution for the new test. We can use .prop('style') and check each of the heading if they have used inline style or not. But if we decide to not use jquery then we can use .getAttribute('style') to test each heading.

0reactions
srijit2002commented, Aug 24, 2021

Yeah, now it is much clearer. Thanks for your precious time. I am working on this and link a pull request soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set the font-size for Multiple Heading Elements (error)
When I run your code, I pass all tests. Here are some things to check: Are you on a supported browser version? -...
Read more >
Applied Visual Design - Set the font size for Multiple Heading ...
We go over the specifics of setting the font size for multiple heading elements in this video. I hope you learn something extra...
Read more >
Set the font-size for Multiple Heading Elements error? - Reddit
I am currently working on font-size in "freecodecamp". ... In this challenge, you'll set the values for all h1through h6 tags to balance...
Read more >
Assessment principles and practices—Quality assessments in ...
These two quotes indicate the scope of the challenge that we face with assessment. Many of the ... assessment (formal testing) element of...
Read more >
Solved: Change font Size / Type - Atlassian Community
I see there are basic styling options including things like Normal Text, Heading 1 etc. BUT I cannot find anywhere where you can...
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