|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
The CSS file that I am creating is going really well, but I'm stuck on a part that I am not sure what to do. I have tried many, many differnet things and am not able to get it to work.
What I want to do is make all <td>'s by default the color WHITE unless otherwise specified. I have some <td>'s that I want "#183cad" color code. Here is my current CSS File: *********** BODY { FONT-SIZE: small; BACKGROUND: url(images/bg.gif) #000000 fixed; MARGIN: 0px; HEIGHT: 0pt } A:visited { FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma, Verdana, Helvetica, sans-serif; TEXT-DECORATION: none } A:link { FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma, Verdana, Helvetica, sans-serif; TEXT-DECORATION: none } A:active { FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma, Verdana, Helvetica, sans-serif; TEXT-DECORATION: none } A:hover { FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #183cad; FONT-FAMILY: Tahoma, Verdana, Helvetica, sans-serif; TEXT-DECORATION: underline } TD { background-color: white; } ******************* How do I code in here to specify "#183cad" for different <td>'s ?? Any help would be greatly appreciated!!!!!!!! |
|
#2
|
|||
|
|||
|
try using classes or unique ids.
i.e. <td class="class1"></td> and <style> td { background-color: <your default color here> } .class1 { background-color: #183cad } </style> or for the ids: <td id="firsttd"></td> <style> #firsttd, #secondtd, #thirdtd { background-color: #183cad } </style> |
|
#3
|
|||
|
|||
|
I have tried both the CLASS and ID Tags within my HTML code to call the funtion in my .css file. I am using an inline CSS File, does this matter? Or does it have to be done a differnet way? Now my CSS File looks like so....
******************* td { background-color: white } .blue { background-color: #183cad } ********************* That's just the last piece. Is that right? If so, it doesn't work. Thanks in advance!! |
|
#4
|
|||
|
|||
|
if you use <td class="blue">...</td> it should work since the last definition should override the first.
it should not matter (in some rare cases it does though) if you use inline css or a linked (<link rel="stylesheet"...>) css. there is some other misunderstanding. there is no functions in css... if you experience problems on a specific browser only, try not setting up a default color but adding class or id properties to ALL <td> tags. |
|
#5
|
|||
|
|||
|
I can't believe I'm having this hard of a time getting this to work hahaah. Anyways, I took into consideration your suggestion on not setting a default color for <TD>'s. So I used the following code in my .css file:
******************** TD { .white { background-color: white } .blue { background-color: #183cad } } ******************* Should this code work? |
|
#6
|
|||
|
|||
|
try yourself. i am busy answering other peoples questions right now
![]() |
|
#7
|
|||
|
|||
|
aaaaah sorry, i think you got the syntax messed up.
it should be: TD.white { background-color: white } TD.blue { background-color: #183cad } |
|
#8
|
|||
|
|||
|
Well I did try it ;-) And it didn't work for some reason. I'll just keep playing with it. Thanks alot for your support!!!
|
|
#9
|
|||
|
|||
|
AHH HAY! You are the man :-)
Thank you much |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS Class Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|