FAQ: Learn CSS Selectors Visual Rules - CSS Visual Rules - Font Size

This community-built FAQ covers the “Font Size” exercise in Codecademy’s lessons on CSS.

FAQs on the CSS exercise Font Size

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about CSS in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

1 Like

What is the default Font size??

I don’t understand it. I wrote the solution exactly, and it was still marked wrong. The only difference was that my “font-size” was orange instead of blue (which I did think was strange, but found no way to change).

I clicked on the Solution and no change happened except “font-size” changing from orange to blue.

This has got to be some sort of bug, right?

1 Like

I was doing a line by line analysis of the Innovation Cloud mock-website and I had a question about font-size:

Here’s the code:

.header h1 {
    color: #fff;
    line-height: 100px; 
    font-size: 80px;
    margin-top: 0;
    margin-bottom: 80px;
    text-transform: uppercase; 
  }

When I deleted margin-top: 0; (for experimental purposes), I noticed a large white bar appeared above the background image. More tinkering revealed that the white bar was a result of the 80px font-size of h1.

Why would increasing the font size of h1 create a white bar above the background image? The background image is in the parent class .header, and h1 is in the child class .container.

this happened to me as well

1 Like

I copied the exact solution code and reset exercise then pasted it and the website kept telling me that I was wrong.

1 Like

I have the same problem in learn css but in html I had nothing like this problem. My browser is internet explorer and I even downloaded google chrome to try it on there and it still does nothing.

If you put the font-size below the font-family it won’t work (turns orange instant of blue)

ex:
p {
color: AliceBlue;
line-height: 1.3em;
text-align: left;
width: 100%;
font-family: ‘Helvetica’
font-size: 18px;
}

But if you move it above it works, it might have something to do with the order in which it loads the code I’m not sure.

ex:
p {
color: AliceBlue;
line-height: 1.3em;
text-align: left;
width: 100%;
font-size: 18px;
font-family: ‘Helvetica’
}

Can the font-size of headers be altered with CSS?

When would you use relative sizing (ems, rems, etc.) and when pixels? When would you use rems, when ems, when percentages, etc.?

It’s not letting me move forward to the next task even though when comparing code, there is no difference.

Hey, @stiven2049 welcome to the forums.

Can you share your code and what step of the lesson you are on?

It was in Fundamentals of CSS → Learn CSS: Selectors and Visual Rules → Visual rules → Font size.

I literally had the exact same code written and placed as the solution. I wrote, “font-size: 18px;” in the p element at the very end. I compared with the solution and there was no difference. I eventually just copied the solution and hit submit so I could move on. It wouldn’t let me otherwise.

On my end, I did not have any trouble. Are you sure that wronte wrote exactly font-size: 18px; on line 38 in the rule for the <p> element.

As far as I could tell I did. The compare feature when viewing the solution didn’t bring up any differences.

The only thing I can think that was different is that in the “Font Family” task before hand, I wrote a separate p element at the bottom of the style.css file. It gave me a correct answer and I moved on but in the “Font Size” task I wrote inside of the already defined p element.

Edit: I should state that my previous p element at the bottom was not brought forward in the “Font Size” task

I just tested that and that shouldn’t be the problem

It accepted this just fine with the other rule above.

1 Like

Alright, no idea then. I just thought I should point it out on the forum as it seemed like an error to me.

Thanks for checking it out though.

1 Like

If you do find any bugs you can report them in #community:codecademy-bug-reporting or through the LE learn how to here.