admin管理员组文章数量:1130349
can i have a structure like below?
<div>
<head>
</head>
<html>
<body>
<body
</html>
<footer>
</footer>
</div>
I am asking this because elementor theme editor when ever some content is placed it creates <html><body>...if i put <html>in header.php this results in validation failure in validator.w3
can i have a structure like below?
<div>
<head>
</head>
<html>
<body>
<body
</html>
<footer>
</footer>
</div>
I am asking this because elementor theme editor when ever some content is placed it creates <html><body>...if i put <html>in header.php this results in validation failure in validator.w3
1 Answer
Reset to default 0Can you have such structure?
Yes, you can have such structure.
Is it valid HTML code?
No, it is not.
Will the browser render it correctly?
Most of the browsers deal with code errors pretty well. So yes - I guess it will render correctly, but it's hard to say what errors will it cause later on. It may cause some JS libraries to work incorrectly, and so on.
Should you write such code?
No, definitely not. It's invalid, so it's an error and should be fixed.
can i have a structure like below?
<div>
<head>
</head>
<html>
<body>
<body
</html>
<footer>
</footer>
</div>
I am asking this because elementor theme editor when ever some content is placed it creates <html><body>...if i put <html>in header.php this results in validation failure in validator.w3
can i have a structure like below?
<div>
<head>
</head>
<html>
<body>
<body
</html>
<footer>
</footer>
</div>
I am asking this because elementor theme editor when ever some content is placed it creates <html><body>...if i put <html>in header.php this results in validation failure in validator.w3
- 2 That's invalid HTML, so no, you shouldn't create such code. What browsers do with that is pretty much undefined. – fuxia ♦ Commented Dec 22, 2018 at 18:41
-
@fuxia thanks , i noticed that it is not from elementor ..even if i use gutenberg it happens the same ...when ever a content is placed
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3/TR/REC-html40/loose.dtd">this tag gets inserted ..any solution to fix this? – user145078 Commented Dec 22, 2018 at 18:46 - 1 Might be an error in your theme. Try a standard Twenty-X theme. – fuxia ♦ Commented Dec 22, 2018 at 18:47
- @fuxia yeah it's my theme mistake. an extra html is some how created when ever content is placed..any way i can check what is inserting that code – user145078 Commented Dec 22, 2018 at 18:52
- Your browser will try to correct invalid markup by inserting tags. – Milo Commented Dec 22, 2018 at 19:36
1 Answer
Reset to default 0Can you have such structure?
Yes, you can have such structure.
Is it valid HTML code?
No, it is not.
Will the browser render it correctly?
Most of the browsers deal with code errors pretty well. So yes - I guess it will render correctly, but it's hard to say what errors will it cause later on. It may cause some JS libraries to work incorrectly, and so on.
Should you write such code?
No, definitely not. It's invalid, so it's an error and should be fixed.
本文标签: theme developmentWhether an lthtml gttag is required in header
版权声明:本文标题:theme development - Whether an <html >tag is required in header? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749075254a2312201.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3/TR/REC-html40/loose.dtd">this tag gets inserted ..any solution to fix this? – user145078 Commented Dec 22, 2018 at 18:46