2 replies [Last post]
asgeo1
Offline
newbie
Last seen: 18 years 9 weeks ago
Joined: 2003-11-25
Posts: 4
Points: 0

Hi all,

I'm having problems in Internet Explorer with font-size property.

Here's the problem:

If I add the <?xml version="1.0" encoding="UTF-8"?> header to the top of my page, the font-size property in Internet Explorer goes all screwy... but only in table cells.

That is, text inside <td> tags is larger then it should be. If I remove this header the page is fine:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style typt="text/css">
	body, td		{font-family:Verdana, Tahoma, Arial, sans-serif;}
	body			{font-size:76%;background-color:#FFFFFF;}
	body			{top:0px;margin:0px;padding:0px;width:100%;}
	p			{font-size:1em;}
	td			{font-size:1em;}
	div			{font-size:1em;}
	pre			{font-size:1.1em; font-family:Courier New, Courier, monospace;}
</style>
</head>
<body>
<p>Testing</p>

Testing

<table>
<tr>
<td>
testing
</td>
</tr>
</table>

</body>
</html>

Try it out for yourself by adding and removing the <?xml?> tag... you'll notice the font size change in the <td> tag.

Why do I need to put the <?xml version="1.0" encoding="UTF-8"?> at the top of my page you ask?

Well without it, coolmenu will not work: http://www.dhtmlcentral.com/projects/coolmenus/

Coolmenu's is a brilliant cross-browser drop down menu system that has been implemented on the project I'm currently working on. Unfortunalty I can't swap Coolmenus for anything else either. I have to keep it.

So, Cool menu's ONLY works when supplying a DTD in Internet Explorer, *if* you have put <?xml version="1.0" encoding="UTF-8"?> at the top of your html. I don't know why... but that seems to be the case.

Unfortunatly as I just mentioned, putting <?xml version="1.0" encoding="UTF-8"?> in your HTML makes the CSS play up in Internet Explorer for <td> tags...

So, I'm not sure what is the solution here... Does anyone know *why* IE is doing this for, and what a possible work around could be?

Thanks

-Adam

asgeo1
Offline
newbie
Last seen: 18 years 9 weeks ago
Joined: 2003-11-25
Posts: 4
Points: 0

font-size problem in IE when using DTD

Note, I realise I made a typo in this tag:

<style typt="text/css">

... that's not the cause of the problem though Tongue

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 4 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

font-size problem in IE when using DTD

Hi asgeo1,
Most of us drop

Quote:
<?xml version="1.0" encoding="UTF-8"?>
as it throws IE into quirks mode.

It looks as if cool menu will only work in quirks mode so if you have to keep the menu you may have to hack around the problems.

Hope that helps