Issues with centering and formatting my header


I’m new to coding and am having an issue with formatting using tags in my CodePen tribute page project.

For instance, I did this for the h2 tag, and it’s not centering, formatting the font, or even coloring the font to be white.

h1 {
  font-size: 19rem;
  margin-bottom: 0;
  font-family: 'Open Sans', sans-serif;
  text-align: center;
  font-color: white;

I’m having issues with the h2 and img tag as well, and I’m really not sure what I’m doing incorrectly (and it could easily be me not knowing how to use CodePen too).

Can someone take a look and share your thoughts? I would greatly appreciate it!

Thank you! :slight_smile:

Hi @bougieblub !

Welcome to the forum!

Two things.

You just need to write color not font-color here

You need to get rid of the style tags.
Those are html tags and do not belong in your css.

Hope that helps!

Hello @jwilkins.oboe!

Thank you so very much!

Good catch on the “color: white”!

Wow, I had no idea that the style tags were the issue. To clarify, does that mean the style tags are needed only when you’re coding in the HTML window of CodePen?

Like how in the tutorials, they would format it like this:

.... code here...

<add HTML here>

I appreciate it!

I think using styles tags are fine in tutorials like in FCC challenges.
When you are doing short challenges it is nice to have everything all in one place.

But now that you are building projects, you don’t need style tags.
It is best to keep your html, css and javascript separate.

Oh, that makes sense. Thank you again @jwilkins.oboe! :star_struck:

1 Like

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