Simple font-size code problem according to fCC test

Why is my h6 not registering my font-size of 14 when all the others (h1-h5) are working with the same code structure? I keep getting an error message telling me I dont have my h6 set to 14 pixels(!?)

Your code so far


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






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

Your browser information:

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

Challenge: Set the font-size for Multiple Heading Elements

Link to the challenge:

Hi @Trailhead !

Two things:

No.1:
It looks like you are missing an opening style tag.

No.2:
This is the correct structure for css.

h6 {
font property goes here
}

You need to use that structure for all headings.

Hope that helps!

well its weird. The h1, h2, h3, h4 and h5 syntaxes are working(?). Im coding the “font-size” right inside the <h> html codes and havent used any brackets on any of them. Arent the brackets required for the CSS that resides between <style> and </style>?

…*** between the style and end style commands?***

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

It is important to make sure anything inside the style tags is written in the correct css format.

Edit: I just realized you altered the html code when you are not supposed to.
That is why you are see the results in your window.
But the instructions don’t ask for inline styles at all.

You were only supposed to add code to the style tags and nothing else.

I just created a new issue on github.

thank you jwilkins.oboe (heart). :slight_smile:

wow!.. jwilkins… so it has to be coded in both the css and the html elements(?). Why wouldnt someone just code it in the html. Does it have to be fully defined in the elements every time? if so, what is the advantage of the css? thank you again for all your insight!

For this challenge, you weren’t supposed to touch the html part here.

This part is supposed to look like this.

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

Your answer was only supposed to be in the style tags.

<style>
h1 {
font property goes here
}
h2 {
font property goes here
}
etc.

You can see the full correct answer in the github issue I posted.

There are three ways you can code in css.

Inline css

Internal css

<style>
h1 {
font property goes here
}
</style>

External css

<head>
  <link rel="stylesheet" href="styles.css">
</head>

When you are working on projects, you will use an external stylesheet.

If you just have a few lines of code and want demo something than internal or inline css are viable options.

What type you use really depends on the situation.

jwilkins, thank you again for your help. I found the resolve. It wasn’t different than my original attempt, but in my original attempt the css code I input was being recognized for all the <h> elements except for <h6>. Thats why i started tweaking and messing around with other css structures and eventually dove into the inline syntax. Anyway, I got it to go through. freeCodeCamp is an AWESOME tutorial tool. As soon as I get money coming in I will DEFINITELY donate. Right now I’m unemployed and looking to “enhance my market value” as a graphic designer.

Just a bit of advice for the rest of your course. Just about all the questions will ask you to use internal CSS between the style tags rather than inline within the html so I would advise trying to get used to it as soon as you can

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