本文介绍了HTML与BODY容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 Richard Cornford写道:Richard Cornford wrote: 至少对于Firefox来说并不完全正确(在Opera上完全不用测试)。在Firefox中,HTML就像其他任何一个容器一样,你可以添加说图像和div'。试试 html { 宽度:100%; 身高:100%; 背景色:# DDD; } 身体{ 宽度:75%; 背景颜色:#FFF; } 现在加上说< img src = ...>介于< / body>之间和< / html> ;. IE在这种情况下进行自动树校正(因此< body>容器仍然使用)。我不知道它是否正确阅读规格 或渲染错误 - 但应该提及。 It is not exactly true at least for Firefox (keep missing to test infull on Opera). In Firefox HTML is a container as any other where youcan add say images and div''s. Tryhtml {width:100%;height:100%;background-color:#DDD;}body {width:75%;background-color:#FFF;} and now add say <img src=...> between </body> and </html>. IE does automatical tree correction in such case (so <body> containeris still used instead). I don''t know if it''s a proper reading of specsor a rendering bug - but should be mentioned. 推荐答案 ....现在添加说< img src = ...>介于< / body>之间和< / html>。.... and now add say <img src=...> between </body> and </html>. 因为(X)不允许HTML文档< img>元素作为子元素 < html>元素,这不是HTML文档。浏览器如何处理 作者的错误是无关紧要的。 - David Dorward< http:// blog .dorward.me.uk /> < http://dorward.me.uk/> 首页是〜/ .bashrc的位置 Since (X)HTML documents are not allowed <img> elements as child elements ofthe <html> element, that isn''t an HTML document. How browsers handleauthor''s errors is irrelevent. --David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>Home is where the ~/.bashrc is 确认 ACK 没有浏览器(我知道)没有无论如何这都是正确的。 例如 HTML { 背景:青色; margin:2em; padding:2em; } 在CSS的正确渲染中,空白的2em由 填充创建的应该是青色的,但是由边距 创建的空白区域的2em不应该。 这个对于你发布的组中的任何一个组来说,这不是一个合适的主题。交叉发布到ciwastylesheets,后续设置。 - Toby A Inkster BSc(荣誉)ARCS 联系我〜 http://tobyinkster.co.uk/contact No browser (that I know of) does this properly anyway. e.g. HTML {background: cyan;margin: 2em;padding: 2em;} In a correct rendering of CSS, the 2em of blank space created by thepadding should be cyan, but the 2em of blank space created by the marginshould not. This is not really an appropriate topic for either of the groups youposted to though. Cross-posted to c.i.w.a.stylesheets, follow-ups set. --Toby A Inkster BSc (Hons) ARCSContact Me ~ http://tobyinkster.co.uk/contact 这篇关于HTML与BODY容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-22 09:30