These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:11 pm Advanced search

Can anyone tell me why this doen't work in IE?

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Can anyone tell me why this doen't work in IE?

Postby Ulrik Hvide » Sun Mar 28, 2010 10:34 am

This might be a little off-topic, but I couldn't think of a better forum to get the answer I'm looking for.

I've been working on a danish blog (http://webr.dk) using html5 and for fun I decided to experiment with the markup. At first I used the standard html5 markup:

Code: Select all
<!doctype html><html><head><title>My poor website</title></head><body>This is my poor website</body></html>


Which obviously works fine, but than I came to think that why declare that the content is html twice (in the doctype + in the <html> tag). So I removed the <html> tag which looks like this http://webr.dk/html5-1.html and still does validate according to w3c.
Then I started to think about removing <head> and <body> tags, I realise this is bad practice, but I still wanted to give it a shot.

http://webr.dk/html5-2.html Here I removed the body tag, but the website still validates according to w3c. In the next test I removed the <head> tag too: http://webr.dk/html5-3.html which also validated according to W3C, thus making me question whether or not this is a bug?

For some reason every browser except MSIE can show the page even when all the 3 tags are removed, but why doesn't is work on IE?

Hope someone got the answers :)
-Ulrik Hvide
Ulrik Hvide
<h6>
 
Posts: 3
Joined: Sun Mar 28, 2010 10:08 am

Postby Ulrik Hvide » Sun Mar 28, 2010 10:52 am

For those of you who like me are happy not to own a microsoft equipped computer, here are some screenshots:

without <html>: http://browsershots.org/screenshots/ec9abd3ee0de1dd2ad9d896121520854/

without <html><body>: http://browsershots.org/screenshots/6c53ca0a4269fa5e4b5894278d229439/

without <html><body><head>: http://browsershots.org/screenshots/e75631e892e0708916009246906221a7/

It seems like I was wrong, it does also work in MSIE, but why doesn't it work on webr.dk then?

webr without <html> and <body> (just as it is atm): http://browsershots.org/http://webr.dk/
Ulrik Hvide
<h6>
 
Posts: 3
Joined: Sun Mar 28, 2010 10:08 am

Postby zcorpan » Sun Mar 28, 2010 11:03 pm

Those tags are optional in HTML. That's why it still validates.

The reason it is broken in IE is because when you remove the <body> tag, IE thinks that the (for IE unknown) <header> element should go into head instead of implying body.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Ulrik Hvide » Mon Mar 29, 2010 10:43 am

zcorpan wrote:Those tags are optional in HTML. That's why it still validates.

The reason it is broken in IE is because when you remove the <body> tag, IE thinks that the (for IE unknown) <header> element should go into head instead of implying body.


One must hate IE I suppose...

Thanks for the help though.
Ulrik Hvide
<h6>
 
Posts: 3
Joined: Sun Mar 28, 2010 10:08 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests