Imx Fix in my experience
 
« prev next »

January 2, 2003 12:53 PM


If you apply a doctype to the content of an iframe that is greater than HTML version 3.2 (as in, 4.0 and above) and then view that iframe using Internet Explorer 6.0.2600 (the only browser I have seen this behavior in so far), chances are you will see a horizontal scroll bar. We all know that horizontal scroll bars are the herpes of web development, never quite going away, but still treatable. In this case, the treatment isn't so desirable.

Adding a doctype of HTML 3.2 will make the horizontal scrollbar go away. But, why were they there in the first place? I don't really know why, but the behavior is the result of the content taking the residence in the full size of the iframe, INCLUDING the vertical scrollbar. So, let's say I have an iframe that is 200 pixels wide and content that is set to take 100% of the space in that frame, well, the content won't be the 200 pixels minus the width of the vertical scroller, it'll be 200 pixels wide, making the horizontal scroller necessary to see the full content. Me no likey.

The solution is easy, but less than desireable. I can use the html 3.2 doctype declaration, or no declaration at all! I'm aiming at HTML 4.01 transitional compliance for my redesign (why not XHTML you ask? That's a blog entry for another day) and I'd like to avoid mixing doctypes.

Thus concludes another chapter in the adventures of UI Development Boy (me).