PDA

View Full Version : Cell font does not appear as intended



guvenck
Aug 13th, 2007, 10:17 AM
Hello,

I have following table:



<table id="maintable">

<tr>
<td>Some content here</td>
</tr>

<tr>
<td>Other content</td>
</tr>

<tr>
<td id="footer">Footer content here</td>
</tr>

</table>


And the CSS:



#maintable {
border-width: 3px;
border-style: solid;
border-color: #FFFFFF;
background-color: #FFFFFF;
width: 100%;
}

#maintable td {
font-family: Verdana;
font-size: 12px;
}

#footer {
background-color: #FF9966;
padding: 4px;
color: #FFFFFF;
font-family: Arial;
font-size: 11px;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
text-align: center;
}



The problem is that the text in the footer td cell appears as Verdana 12px. Shouldn't the CSS for the footer id override previous elements?

ahallicks
Aug 13th, 2007, 11:10 AM
#maintable td will override #footer because it is a more precise path and using the point scale has a higher number and therefore will be read over the top of #footer.

Try adding:


#maintable td #footer {
font-family: Arial;
font-size: 11px;
}

and keep the rest of what you have there

guvenck
Aug 13th, 2007, 04:36 PM
#maintable td #footer {
font-family: Arial;
font-size: 11px;
}


did not work but this one did instead:



#maintable #footer {
font-family: Arial;
font-size: 11px;
}


Thanks for your help!

ahallicks
Aug 13th, 2007, 04:50 PM
Yeah, sorry I didn't actually mean to put that space in there:

#maintable td#footer

The above is a slightly more relative path than the one you have used, but either should work. Sorry!