Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change red text to another color (if-then-else) within CSS

Status
Not open for further replies.

Bilberry

Programmer
Dec 17, 2007
111
0
0
NL
Hi,
My vendor adds a red license text, which is automatically created, within the pages. I can overrule the basic CSS adding for example the following example:

<style>
td { color: #635D5A !important; font-weight:100 !important; }
</style>

I can change the background color of the text, but i want to change the color of only the text: MyLicense. Is that possible? So when the text is Mylicense i want to add another color for this piece of text. With the change:
td { color: #635D5A !important; font-weight:100 !important; }
all of the colors has been changed...

Any idea's



 
Put the MyLicense text in its own named class

Code:
.MyLicense {color:#635D5A;}

<span class="MyLicense">Red Text</span>

Or if that text is wrapped in any other HTML tag with class then just add your own style for that.

If it's not wrapped in anything that you can somehow isolate then you will need JS as well.

Darryn Cooke
| Marketing and Creative Services
 
If I just take this:

>i want to change the color of only the text: MyLicense. Is that possible?

Without changing the HTML, only adding user CSS styling you can style classes or tags, but not certain words. That's the main problem. With the example you change the CSS within td tags, which are table cells. For more specific changes you also need to change html, so it's not possible with only changing CSS.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top