Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-03-2009, 07:13 PM   #1 (permalink)
Rubik's Uncle!!
 
Charan's Avatar
 
Join Date: Sep 2004
Location: ಬೆಂಗಳೂರು (Bengaluru)
Posts: 3,786
Default Conditions in CSS


Hi guys, I need some help in CSS.

I have a table in which the row values are something like this

------------------
|YES|NO|
|NO|NO|
|NO|YES|
----------------

I want to make the forecolor for "YES" as green and "NO" as red.

how can this be achived in CSS. if there any if else statement in CSS?
if this is difficult to achive then can CSS change the color of those text if found anywhere in whole body?
__________________
i5 2400 | DH67BL | G.Skill Ripjaw 4 GB | FSP SAGA II 500W | CM 430 Black Elite | MSI R6850 Cyclone PE/OC | XBox 360 Controller | 21.5" Samsung Sync Master 2233 | 4 Mbps @75GB FUP :)
Battlefield 3 Multiplayer Discussion | Battlefield 3 Low Latency Servers List
Charan is online now  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 06-03-2009, 01:01 PM   #2 (permalink)
Canon 1000D
 
astroutkarsh's Avatar
 
Join Date: Apr 2007
Location: Pune
Posts: 80
Default Re: Conditions in CSS

well, there is no If..Else in CSS.
You can use Java script for this.
You can check "innerText" of an element (td in your case).
Then you can apply new style to this Element object like
objElement.style.backgroundColor [ = sColor ] where sColor can be "transparent" or Hex value of color.
__________________
Canon 1000D + 18-55 + 50mm f/1.8 + 55-250 IS :-)
astroutkarsh is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to buy Lost Planet:Extreme Conditions(PC)? sandman9 Gamerz 6 16-12-2007 01:44 PM
will apple macbook work in indian heat conditions kaushiklingam QnA (read only) 13 19-09-2006 12:01 AM

 
Latest Threads
- by Sujeet
- by gforz
- by soumya
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:08 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2