开发者

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

开发者 https://www.devze.com 2023-02-17 10:13 出处:网络
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.

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 i开发者_如何转开发s, what would be the outcomes having this kind of code/ html markup.

Thanks!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号