Jump to content

XHTML 1.1 Strict DTD and 100% height


atholon

Recommended Posts

Have any of you guys run into the issue with XHTML and 100% body height? If I don't use any DTD on my pages I can specify 100% height for the body of my page but once that DTD is on there it removes that capability. I've seen somewhere that W3 has depreciated 100% height and width on the body... but I couldn't find anything on their site.

 

Does anyone know what we are supposed to do now if we still want that DTD/W3 validation?

Link to comment
Share on other sites

  • 2 weeks later...

xhtml is not 'fake' html at all in any browser. its an extendable version of html, which means that if you want to use xml for feeds etc, you can.. your right that it reads it as html ( but that's in every browser, not just IE, ) it would make no issues to the coding itself as its perfectly valid and legal to use whether you are using xml or not.

 

with the issue of height 100%.. if you just dont mention the height at all, that is exactly like height 100% because its not restricted by an 'un-said' height, it just keeps going until its stopped by a div, table or the bottom of your screen.

Link to comment
Share on other sites

I really dont know where people get that idea from.. I am honestly interested in where it says that at w3c? ( and being totally honest I am not interested in an 'un-official' debate to prove a point from a place that has no official authority ) .... so in your eyes, even w3c are using 'fake' html because if you look at their doctype it also has text/html on an xhtml doctype.

 

until I see it at w3c ( It might be there, im not saying its not ) my view on it is this

 

if you had a car, and you added a caravan does that mean its no longer a car ?.. in my view its an extension of the car.

Link to comment
Share on other sites

http://www.w3.org/TR/xhtml-media-types/#text-html

 

XHTML documents served as 'text/html' will not be processed as XML [xml10], e.g., well-formedness errors may not be detected by user agents. Also be aware that HTML rules will be applied for DOM and style sheets (see guidelines 11 and 13).

 

You can do a quick little check yourself. Find an "XHTML" document served as text/html (e.g. this page) and then find a self-closed tag. Check the source in Firefox. Notice that the / is in red. Now create an XHTML page and serve it as application/xhtml+xml. Notice that it is no longer red. Why does this happen? Well, something like <br /> is invalid HTML, so if you tell the browser via the content-type header that it's HTML, it'll treat it as HTML. Firefox marks up syntax errors in red. Try to make a a more drastic syntax error and notice the red-ness.

 

I would recommend you to read the thread I linked to. It has already been discussed, and I believe I proved some additional examples of how the parsing differs if you use text/html versus application/xhtml+xml. If you have anything new to add, I'd be happy to discuss it with you in that topic. I'm not interested in reiterating myself, however.

Link to comment
Share on other sites

I have seen that line you have copied up on w3c, but it still does not say that its serving 'fake' html, all it says is that the xml bits will be ignored ( so its not 'serving' the xml at all, only the html - meaning its not serving 'fake' html to the end user )

 

like for example, php is ignored

Link to comment
Share on other sites

Things served as text/html are treated as HTML, things served as image/png are treated as PNG, things served as text/plain is treated as plain text. It's common sense, and it's how the HTTP protocol works; you treat things like the content-type header says it is. It doesn't make sense if it should handle any other arbitrary data. So do you expect that if you put Haskell, Ada or C that it would interpret and execute that as well? Probably not, so why do you expect the same for XHTML? Sure, I can distinguish between these languages, but a computer cannot, so it just assumes you aren't lying.

 

Also, what do you mean with "PHP is ignored". The browser doesn't ignore PHP.

 

You are also contradicting yourself. You say "the xml bits will be ignored". If you ignore the XML bits in XHTML then it is per definition not XHTML. When parsing HTML you specifically ignore invalid things and try to serve it up anyways. Just because it doesn't have draconian error handling like XML and halts at a syntax error doesn't mean that it regards the invalid data as valid, or accepts anything you give it.

 

Again, I would recommend you to read the topic. You are hardly bringing anything new to the discussion.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.