• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
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?
 
Marshal
Posts: 67420
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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 ]
 
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
Marshal
Posts: 67420
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
This tiny ad will self destruct in five seconds.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic