Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

DOCTYPE causes <h1> alignment problem in Firefox

Confused - please help



6:26 am on Nov 5, 2004 (gmt 0)

10+ Year Member

I have some text in the top left hand corner of a table cell, which was working ok until I put the DOCTYPE statement in my code. It now drops the text down in Firefox, but is still fine in IE.

If I remove the H1 tag or the DOCTYPE declaration it displays correctly again.

I know I could just lose the H1 and increase the text size, but I would like to keep the H1 for SEO.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<title>New document</title>
<table width="770px" border="1">
<tr height="120px" width="400px" >
<td valign="top" ><h1>>Widgetguide.com</h1></td>

Anyone have any ideas to get round this?



6:47 am on Nov 5, 2004 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Try <h1 style="margin:0;"> -- or better still, add the same rule to an external css file if you have one.

It sounds like a Quirks Mode vs. Standards Mode [webmasterworld.com] issue. The full DTD switches modern browsers into standards mode and IE (even version 6) is pretty far from standards, so you only see this in newer browsers.


7:29 am on Nov 5, 2004 (gmt 0)

10+ Year Member

Thanks Tedster, problem solved

Featured Threads

Hot Threads This Week

Hot Threads This Month