PDA

View Full Version : Arrow Comment Box - IE vs. NS



rb657062
06-05-2006, 03:59 AM
I'm noticing a problem with the width of the comment box. In Netscape, the width is the exact length I specify, but in Internet Explorer, the right side of the comment box is cut off by approximately 15 pixels.

I checked the Arrow Comment Box page on Dynamic Drive, and the problem doesn't occur when I view it in Internet Explorer. I'm not sure what I'm doing differently. I copied the css and html code exactly as provided.

Has anyone else encountered this problem (and overcome it) ?

Here's the trial page I made: http://www.wam.umd.edu/~rzuckerm/comment_box.html
Try comparing the comment box width using the two browsers I mentioned.

-Rachel

rb657062
06-10-2006, 09:46 PM
Well, I figured it out. I don't understand why, but if I start my webpage without:

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

the width will differ depending on which browser I use. Could anyone take the time to explain the reasoning behind this occurance? I've been exposed to this code several times, but I never understood why it mattered. I always had the impression, it was optional.

mwinter
06-10-2006, 10:07 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">Normally, any new document should be written to a Strict document type, using the following declaration:



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
The Transitional document type should be reserved for legacy documents.


the width will differ depending on which browser I use. Could anyone take the time to explain the reasoning behind this occurance?In days gone by, browsers exhibited many rendering bugs. More recent versions have long since corrected them (though IE6 still maintains a large number). As (unfortunately) the majority of documents on the Web inadvertently rely on these bugs to display correctly, browser vendors made the decision to keep these display bugs within the code base of their browsers. However, to allow authors who know what their doing to write valid, conforming documents and to take advantage in newer features, the vendors implemented a switch using the now infamous DOCTYPE Sniff.

For a good article on DOCTYPE switching, see Activating the Right Layout Mode Using the Doctype Declaration (http://hsivonen.iki.fi/doctype/) by Henri Sivonen.


I've been exposed to this code several times, but I never understood why it mattered. I always had the impression, it was optional.The document type declaration is (formally) mandatory, but as browsers don't implement HTML as it is specified, they will still render malformed documents. However, as the declaration places newer browsers into 'Standards' mode, continuing to omit it is usually a mistake.

Mike

rb657062
06-10-2006, 11:29 PM
I once tried reading up on this subject, but the author bored me to death within two minutes. Luckily, you summarized the topic quite nicely and the webpage you recommended conveys information well. I especially like the chart at the bottom.

Thank you! :D