Linking CSS with HTML on Codepen

Hey Everyone,

This is my first time trying to make something from scratch, so I know I have have several errors already, lol. But I’m trying to make the style element on my CSS column (word choice?) show up on my preview. For example, I say I want the h2 text to be blue, but nothing happens. Why?

Thanks!

When using codepen, you don’t need the style tags. Actually, don’t write them at all. The css section is not expecting any html tags in that section.

However, since you did put it, let me remind you that for a large majority of html element tags, you must close the tag for html to work.

Ha! Forgot to close it. But that still doesn’t solve my problem of “How do I get my h2 text to be the color blue?”

I wrote in the first half, don’t write any html in the css section. It will make css not work.

1 Like

Ok, thank you! Got it.

1 Like

remove <style> tags from CSS.
all stuff for <head> in html (like meta tags, imported fonts, title etc) you add by going to “Settings” and then you’ll see at the bottom part, it says "Stuff for<head> " :slight_smile:
Also, in Settings > CSS you add Bootstrap, and
in Settings > JavaScript you add jQuery
you’ll get a hang of it :slight_smile:

Thank you so much for your help and encouragement!

1 Like

Don’t mention it, we’ve all been there :smiley:
Just keep learning and coding , don’t get discouraged :slight_smile:

In css section: h2{
background-color: blue;/for background/
color: red;/for font color/
}

This also works for classes and id’s.