grchris
asked on
CSS styles - how to??
I'd like to know how to apply CSS styles to a tag such as "TD" with a few conditions. EG - How to make the stylesheet overide any other size settings that may be in place. Also if the browser is incompatible with stylesheets to enable the html fontsizes to exist also????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
create a style sheet first
<STYLE>
<!--
TD.ITEM {
vertical-align: top;
background-color: #FFFBF0;
}
TD.COUNTER {
padding: 0mm;
background-color: #0000FF;
font-family:"Courier New";
font-size:11pt;
font-weight: bold;
color:#00FF00;
}
-->
</STYLE>
and in HTML file
<TABLE>
<TR>
<TD CLASS=ITEM></TD>
<TD CLASS=COUNTER></TD>
</TR>
You just have to specify the style to apply to the tag, and that will overide the default style for that tag.
as for the conditions, let say netscape and ie, unless you have a program in the serverside to send the right style sheet to the user.
<STYLE>
<!--
TD.ITEM {
vertical-align: top;
background-color: #FFFBF0;
}
TD.COUNTER {
padding: 0mm;
background-color: #0000FF;
font-family:"Courier New";
font-size:11pt;
font-weight: bold;
color:#00FF00;
}
-->
</STYLE>
and in HTML file
<TABLE>
<TR>
<TD CLASS=ITEM></TD>
<TD CLASS=COUNTER></TD>
</TR>
You just have to specify the style to apply to the tag, and that will overide the default style for that tag.
as for the conditions, let say netscape and ie, unless you have a program in the serverside to send the right style sheet to the user.
ASKER
Batalf? thanks for the answer, ermm can css style sheets contain code?
EG. If netscape then
something
else if ie then
something else
end if
Otherwise I suppose I could set a session variable to pick what stylesheet to use on each page....
EG. If netscape then
something
else if ie then
something else
end if
Otherwise I suppose I could set a session variable to pick what stylesheet to use on each page....
http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp#ie40_cssref
http://builder.cnet.com/Authoring/CSS/table.html