Monday 15 September 2014

html - Stray end of tag head -



html - Stray end of tag head -

i trying larn utilize framesets in html. so, started little website friend. in next page (index.html) receive error on line 13: "stray end of head tag". why error?

<!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <title>metal's page</title> <frameset cols = "20%,*" frameborder = "0"> <frame src = "pages/menu.html"> <frameset rows = "10%,*" frameborder = "0"> <frame src = "pages/title.html"> <frame name = "main" src = "index.html"> </frameset> </frameset> </head> <body bgcolor = red> <br/><br/><br/> <p>hello, name mihai, 1 of best friend phone call me "metal". our web page. enjoy!</p> <br/><br/> </body> </html>

website address: metalblog.besaba.com thanks!

you don’t error message document, unless manually tell validator ignore doctype , utilize html 4.01 frameset instead.

if that, or if alter doctype html 4.01 frameset doctype, error “ end tag element "head" not open” because <frameset ...> implicitly closes head element, not allowed close again.

the reason implicit closing in frameset document, frameset element appears instead of body element, after head element. there no body element, since contents of frames displayed.

the next document validates:

<!doctype html public "-//w3c//dtd html 4.01 frameset//en" "http://www.w3.org/tr/html4/frameset.dtd"> <html> <head> <title>metal's page</title> </head> <frameset cols = "20%,*"> <frame src = "pages/menu.html"> <frameset rows = "10%,*"> <frame src = "pages/title.html"> <frame name = "main" src = "index.html"> </frameset> </frameset> </html>

note have removed frameborder attributes. not valid in html 4.01 (or in other html version). if want remove borders between frames, have utilize attribute , take document not valid. @ to the lowest degree there no way remove borders few seasons ago, when frames still used some, though lastly season; don’t think there has been alter in respect.

html

No comments:

Post a Comment