Firefox is telling me that my pages are being rendered in 'standards compliance mode' based on the doctype...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
After changing it to <!DOCTYPE html>
, I noticed some changes in how the page is displayed. I always believed that the doctype was mostly for validators and as long as the rendering was 'standard' instead of 'quirks', everything should be fine. However, it seems there's more to it than just that.
For example, an <img>
with a height of 100px inside an <a>
tag used to display as 100px high, but now it's showing up as 105px. If I set the <img>
to display:block
in the CSS, then it looks correct. But why the difference? The page was supposedly already in standards mode, not quirks (if I remove the 4.01 doctype, everything goes haywire and Firefox indicates quirks mode). Are there multiple types of 'standards' modes? What other factors should I consider? Is there a comprehensive list available somewhere?
(I tried searching online for answers, but all I found were outdated resources that didn't address my specific issues).