Login | Register | FAQ
Anonymous

Brand New to code, font color not working

+ Post a reply

2 posts Page 1 of 1


Brand New to code, font color not working

by Pax Bellum » Thu May 24, 2012 8:41 pm

I'm brand new to web coding. I've gone through the HTML tutorials and feel like I have a fairly decent grasp of how all of that works. However, I'm already running into some trouble using CSS.

I'm playing around, creating a mock website to learn what I'm doing. I've set the background color, put in a headline of a different color and want text of still a different color. The problem is in the p text color. Here's my style sheet code:


body {background-color: #000000;}

h1 {color:#000000; background-color:#FFFF00;}

p {color:#FFFFFF; font-family:arial, verdana, sans serif;}

I understand that I probably don't need the color in h1 as the default is black, but I figured it was better to be safe than sorry. However, since the background is black in the main body, I wanted the text to be white. When I open this page in browser, the background is black, the headline shows up nicely, but the paragraph text doesn't show up at all. I have to highlight it to see it. What did I do wrong?

I'm sure this is addressed somewhere, but I haven't found it in the tutorials or on these forums. Any help would be appreciated. Thanks!
User avatar

Pax Bellum

  • Posts: 2
  • Joined: Thu May 24, 2012 8:27 pm

Re: Brand New to code, font color not working

by Pax Bellum » Fri May 25, 2012 8:10 pm

Thank you CubeSquare! I looked through your example and couldn't see where my issue was. My HTML doc looked almost identical to yours (minus the text, of course). So, I changed from HEX to simply using the word "white" and it worked. Then changed to a different color and back to the HEX value and it continued to work. So, either I didn't have the correct number of F's in the color code, or there was a glitch in my computer.

I appreciate the help and prompt reply! Thanks again.
User avatar

Pax Bellum

  • Posts: 2
  • Joined: Thu May 24, 2012 8:27 pm


+ Post a reply

Page 1 of 1