• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Html doctype [xhtml 1.0 strict] vs [html 4.01 transitional]

b4u

Golden Member
Hi,

Messing up with a basic sandbox example I was making for xhtml 1.0 strict validation purpose, I found some interesting results between FireFox and IE.

Let's start by the attached code.

If I submit the code in W3C Validator Page I can check it's a Valid XHTML 1.0 Strict! which was my intention.

So far so good ... now open it with Firefox, all seems correct. Now change just the DOCTYPE declaration to:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Now refresh the Firefox browser ... in my 1.5.0.3 version of FF, the space between the links shrinks a bit.

In IE, this behaviour does not occur.

So, is it a Firefox bug? Anyone has any other idea about the subject?


Thanks.
 
I don't understand how it must be rendering properly ... for example:

Let's add attribute style="background-color:red;" to menu item "Two", it get's something like I post in the attached code.

That attribute will highlight the line two in red color. As I see in the style block, I'm defining it's height to 17pixels. It works in doctype html 4.01 transitional, but in xhtml 1.0 strict I'll get a final width of 20pixels ... so unless I have to do it another way in css to setup height, I can only assume it renders incorrectly. Or is there something I'm not seeing?

Thanks
 
If I'm not mistaken, you shouldn't use the style property in xhtml strict; it should be done through css.
 
The correct way should be through css, but still it is allowed in xhmtl strict and w3c validator accepts it as style attribute. Anyway, if you put it in css you will still achieve the same result.

One thing I noticed was that if I setup the height in the css (correctly at 17px) up until 20px, it always ends up being a 20px height. If I put 21px, then it starts to end as defined ... so the way I see it, it only resolves if height >=20, any other value resets to 20px. That's why I say it's a bug ...
 
Back
Top