本文介紹了在 HTML </head> 之間放置代碼或內容是否合適?和<身體>標簽的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
是否可以將 HTML 代碼放在頭部區域的結尾和正文區域的開頭之間.我以前在各個站點上都這樣做過,沒有任何問題,但是,我想知道這是否有任何向后兼容性問題,以及這是否常見或良好的做法.例如:
Is it okay to place HTML code between the ending of the head area and before the beginning of the body area. I have done this before, on various sites without any problems, however, I would like to know whether this has any backwards compatibility issues, and also whether this is common, or good practice. For example:
</head>
<div id="header">
<h1>Heading</h1>
Code & Content...
</div><!-- #header -->
<body>
Code & Content...
</body>
推薦答案
不行,不行.頁面的所有內容都應該放在 <body>
中.檢查 HTML 規范.瀏覽器真的很寬容,但即使它有效,你也不應該這樣做.
No, is not okay. All the content of the page should go inside <body>
. Check the HTML specification.
Browsers are really forgiving, but even if it works you shouldn't do it.
這篇關于在 HTML </head> 之間放置代碼或內容是否合適?和<身體>標簽的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!