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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

class mentioned in span or div and td

Status
Not open for further replies.

vinayak

Technical User
Sep 17, 2001
50
IN
Hi,
I have a HTML where in I write the css class either in a div
like &quot; <DIV ALIGN=&quot;right&quot; CLASS=&quot;label&quot;>Field
marked with <FONT COLOR=&quot;FF0000&quot;>*</FONT> is required.</DIV>&quot;

OR in a TD
&quot;<TD CLASS=&quot;label&quot;> Date Range</TD>&quot;

Each time I mention the clas in anything other than TD, the font of the displayed text gets reduced, other wise the fonts are OK.

What could be wrong?

 
Nothing wrong here.
Not every CSS property can be applied to any html element.
 
unless you actually specify the font size for the 'label' class in your style sheet, the enclosed text will assume the default font size of the surrounding element.

For example:
Code:
<STYLE>
div {font-size: 11px;}

td {font-size: 14px;}


.label {color: #003399;}
</STYLE>
If you use <TD CLASS=label>some text here</TD> your text will be blue at 14px, whereas if you use <DIV CLASS=label>some text here</DIV> your text will be blue at 11px.
Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top