Forum Moderators: not2easy

Message Too Old, No Replies

large font sizes in td

font size table td

         

Stooshie

11:22 am on Jul 27, 2005 (gmt 0)

10+ Year Member



Hi there,

I am getting a larger font size in td tags than I am in the p tags with the same font-size. In order to make them look the same as those in the td tags I have to put a smaller font size in the td.


body
{
font-family: Verdana, Helvetica, Sans-Serif;
color: #000000;
font-size: 0.9em;
text-align: center;
line-height: 1.4em;
margin: 0px;
}
p
{
font-size: 0.9em;
line-height: 1.4em;
}
th
{
text-align: left;
font-size: 0.8em;
line-height: 1.4em;
font-weight: bold;
}
td
{
font-size: 0.8em;
line-height: 1.4em;
}

As you can see, the td and th tags tags need to be 0.8 em to look the same as the p tags 0.9em.

Any ideas?

p.s. This happens in IE, Mozilla and Opera.

Best regards,

Andrew Wilson.

alias

11:26 am on Jul 27, 2005 (gmt 0)

10+ Year Member



em is the relative value of the size. I suppose to make them look the same try using px for the values (e.g. 12px;)

Stooshie

11:33 am on Jul 27, 2005 (gmt 0)

10+ Year Member



Thanks for your reply however, I can't use fixed sizes, as accessibility guidelines don't allow.

I think I've worked out what's happening. The td tags do not seem to inherit from the body tag, but the p tags do. So the p tags are relative to the body tag, whereas the td tags are relevant to the default.

I think I'll just have to use my smaller size for the td tags.

Oh well.

Best regards,

Andrew.

encyclo

12:28 pm on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What doctype are you using in your HTML, Stooshie? Inheritance problems can occur when not using a full doctype to trigger standards-compliance mode in the browser.

Stooshie

12:41 pm on Jul 27, 2005 (gmt 0)

10+ Year Member




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en-GB">
.
.
.
</html>

encyclo

1:05 pm on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this one to see if it makes a difference:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Oh, any by the way, you should only really define the language with the two-letter language code unless you have different versions for the language variant (en-GB, en-US, etc.)

<html lang="en">

Stooshie

1:38 pm on Jul 27, 2005 (gmt 0)

10+ Year Member



That worked.

Thanks.

Best regards,

Andrew.