Forum Moderators: open

Message Too Old, No Replies

When I use 4.01, it makes the page not fit

HTML 4.01 Transitional Doctype

         

webworker us

7:32 pm on Apr 7, 2006 (gmt 0)

10+ Year Member



I'm in the process of implementing Doctypes and am trying to use 4.01 Transitional. I can validate the page just fine, but when I view it, IE makes the page too wide (its in a frame). I've done some extra checking, and it only happens if the content is longer than the window. FF pulls it off without a hitch however. Any guesses as to what I'm doing wrong?

I've supplied a shortened version of the page below. Just continue the images in the table until it reaches more than the window size.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Contact</TITLE>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" type="text/css" href="base.css">
</HEAD>
<BODY>
<table>
<tr>
<td>
<img src="blah.jpg" alt = ""></td><td>Blah<br>President<p>(555) 555-5555<p><a href="mailto:blah@blah.com">blah@blah.com</a>
</td>
</tr>
</table>
</BODY>
</HTML>

Casey

kaled

7:58 pm on Apr 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's IE that's getting it wrong.

If you remove the url from the doctype, IE will revert to quirks mode and get the width calculation right for the page (I think).

Kaled.

webworker us

8:12 pm on Apr 7, 2006 (gmt 0)

10+ Year Member



Will that hurt anything other browser wise?

doodlebee

8:25 pm on Apr 7, 2006 (gmt 0)

10+ Year Member



You may try using a conditional comment to strip the extra margin/padding that IE sticks into stuff like this - it might help without touching the doctype...

bedlam

8:43 pm on Apr 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Any guesses as to what I'm doing wrong?

Sure, but until you provide some more information--especially any relevant css--then you're only going to get guesses. The suggestions so far could all help, but none of them will really get to the root of the problem.

The first, and most obvious solution (if this is indeed an IE bug) would be to take the content of your sample out of the table (assuming also that the table only really has a single td as in your sample).

The next thing I'd suggest is to explicitly set the size of the table. In a frame, it may not be possible to set the size of the table using percentages (i.e. since I guess a size of e.g. 80% would be 80% of the size of the body element in the page containing the table, not of the frame in the frameset...)

-b

webworker us

8:49 pm on Apr 7, 2006 (gmt 0)

10+ Year Member



Thanks for all the replies. I've removed the link from the doctype and it seems much happier. Before I posted, I tried removing the CSS link (didn't help) and setting the table width (which it did, but again did not help). I just tried taking the content out of the table (separating the images by paragraphs) and it still had the same problem.
Casey

tbear

10:08 pm on Apr 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think we'd need the frame details, since that is the main control for the page....

kaled

11:28 pm on Apr 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only CSS-type fix I've found for this problem in the past is to use something like body { width:96% }. What you actually need to do is reduce the body width by the width of the scrollbar.

Kaled.

webworker us

2:16 pm on Apr 10, 2006 (gmt 0)

10+ Year Member



Here is the frame code. So far it isn't W3C because I need to add the trick so IE will see one frameset and all the other browsers will see another.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<title></title>
</HEAD>
<frameset framespacing='0' frameborder='0' cols='240,*' marginheight = '0' marginwidth='0'>
<frame name=TOC src="toc.htm" marginwidth="0" marginheight="0">
<frameset rows="115,*" marginheight="0" marginwidth="0">
<frame name=TOP src="building.htm" marginwidth="0" marginheight="0">
<frameset rows="30,*">
<frame name=HEADER src="top.htm" marginheight="0" marginwidth="0">
<frame name=MAIN src="main.htm">
</frameset>
</HTML>

Casey

DrDoc

6:47 pm on Apr 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you remove the url from the doctype, IE will revert to quirks mode and get the width calculation right for the page (I think).

For everyone's information ... it is by using a doctype (including the URL) that IE will get widths and heights right. Without either, IE goes into quirksmode and that's when it gets things all wrong.

kaled

12:50 am on Apr 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's true, except in this case (as described) using frames - try it for yourself.

I use frames, I've encountered this problem, identified the cause and found the solution.

Kaled.

DrDoc

1:25 am on Apr 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The reason could also be related to the invalid code.