Jump to content

CSS text color autochange rule


snoboardman96

Recommended Posts

Hi all, I am a fledgling web developer still looking to jump the nest yet. However I have lately been having to dig deep into the writing end of web development for the company I work for. My problem is I have 140,000+ products all of varying colors and I would like to be able to set an autorule in this specific field that grabs a certain word (blue for example) and change the font color.

  • Has anyone run into this?
  • is it possible even to do?
  • suggestions wouldn't go amiss.
  • let me know if more information is needed.

}table, td, .bgcolor1, .bgcolor2, .bgcolor3, .pricecolor, a.regularlink, .nav1, a.nav1, .nav1_selected, a.nav1_selected, .nav2, a.nav2, .nav2_selected, a.nav2_selected, .nav3, a.nav3, .nav3_selected, a.nav3_selected, .navbottom, a.navbottom, .navspecials, a.navspecials {font-size: 12px; font-weight: bold;} Thank you all in advance for any help provided.

Link to comment
Share on other sites

CSS is not capable of doing that. It would be complicated but Javascript can find some text and wrap it in an element with CSS style attached.

  • Like 1
Link to comment
Share on other sites

you can target an attribute, if the colour is pick up from database, you could add it to specific attribute, and use css to apply styling to it HTML5 data storage attribute validates and works, X/HTML works but validates? maybe not. <div data-color="blue">Blue product</div> css [data-color=blue]{color:blue;} <td bgcolor="blue">blue</td> td {background-color:transparent;}[bgcolor=blue]{color:blue;}

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...