• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Do I Fail to Change the Color of Text Using .css?

 
Daniel Gee
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to use style sheet to change the color of text; but the color does not change. In my style sheet, I have

.dataContent
{
font-family: Verdana, Arial, Helvetica, Sans-Serif;
font-size:8pt;
color: #FFFFFF
}

Because the background is dark, the text should show when I set the color to white. But, the color of the text is still dark.

What could go wrong?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dunno. Maybe the browser's being picky about the missing semi-colon? The one's I tested didn't care.

Are you applying the style class where you think you are?

Are there other style rules that could be over-riding the color?
[ March 07, 2006: Message edited by: Bear Bibeault ]
 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Daniel Gee:
I tried to use style sheet to change the color of text; but the color does not change. In my style sheet, I have

.dataContent
{
font-family: Verdana, Arial, Helvetica, Sans-Serif;
font-size:8pt;
color: #FFFFFF
}

Because the background is dark, the text should show when I set the color to white. But, the color of the text is still dark.

What could go wrong?



this is only a suggestion. cannot guarantee if it will work
try to use this:



in your span or textbox or whatever put the id="dataContent"

maybe bear is right about your browser
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changing a class to an id would just be a band-aid solution. Better to find out why it isn't working as it's liable to be a recurring problem caused by whatever the root problem is.
 
Daniel Gee
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OKay, it worked after I re-boot the computer. Something was cached there and could not get rid of it. Thanks for your attention.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic