Search code examples
htmlmarkup

html markup: multiple/repeating html,head, body tags, etc. - consequences


I'm working on a website project w/ a team. And they started the code, it seems messy for me. we're having php includes for some sections of a page.

e.g. in the part of index.php we have:

<?php include("pages/header.tpl");?>, and inside this, we also have:

`<?php include("pages/submenus/commercial.sbm");?>`

inside, header.tpl are the menu bar, and inside commercial.sbm are the pop-up hover submenu items.

The thing is, in these 3 files, we have <html>, <head>, <body>, <script>,<style> tags

so, these tags now are being repeated in one page -eg. when i view source index.php

I know this is not a valid HTML mark-up right?

My question is, what would be the outcomes having this kind of code/ html markup.

Thanks!


Solution

  • This really depends on which browser you're using and how it parses the file. If you use the developer tools in chrome, safari, or firefox (via firebug), you can see the end result of the parse. Browsers that implement the HTML 5 parser algorithm should all give the same result for malformed markup such as duplicate head and html tags, but there are still many browsers in use that don't.

    The best option is really just to fix the bad markup.