Ask coding questions

← Back to all posts
CSS not working for some reason
h
IntellectualGuy (693)

For some reason the font color is not working can anybody help?

Answered by SixBeeps (5060) [earned 5 cycles]
View Answer
Comments
hotnewtop
SixBeeps (5060)

This is gonna sound really stupid, but hear me out:
Your style.css has three spaces at the beginning of the file name. Delete them, then your stylesheet will link properly.

IntellectualGuy (693)

@SixBeeps Oh, crap It must have happened when I was changing the file name

IcynDevz (764)

it doesn't have to be that complicated, in the CSS, do

h1 {
  color: orange 
} 
SixBeeps (5060)

@IcingHackz you forgot a semicolon btw

IcynDevz (764)

@SixBeeps you don't need a semicolon in CSS, you only need it in JS.

p.s. I just tried it, it worked in a repl
SixBeeps (5060)

@IcingHackz Other way around. You don't need semicolons in JS, but you need semicolons in CSS if you have more than one property in a rule.
Here's a Repl showing this.

IcynDevz (764)

@SixBeeps Well look at this
HTML

CSS

Output

IcynDevz (764)

@IntellectualGuy oh, then yes, you need a semicolon