+ -
当前位置:首页 → 问答吧 → 大家来看看.为什么要这样写命名啊?

大家来看看.为什么要这样写命名啊?

时间:2011-01-21

来源:互联网

html>body   这个">"大于号在这里代表什么来的.
还有这个<?xml version="1.0" encoding="UTF-8"?>  干嘛的.
去掉了在IE6下出问题了.
最近在研究以前的那篇帖子:http://bbs.blueidea.com/thread-2818595-1-1.html
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>WiseInfo</title> <style type="text/css"> <!-- * { margin:0px; padding:0px; } html, body{ height:100%; overflow: hidden; } html>body{ /*-- for !IE --*/ width: auto; height: auto; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; } body { border:8px solid #ffffff; background-color: #808080; } #mainDiv { width: 100%; height: 100%; padding:20px; background-color: #ffffff; border: 10px solid #808080; } body>#mainDiv{ /*-- for !IE6.0 --*/ width: auto; height: auto; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; } --> </style> </head> <body> <div id="mainDiv"> </div> </body> </html>
 提示:您可以先修改部分代码再运行

作者: rao3324180   发布时间: 2011-01-21

引用:
E1 > E2 { sRules }
这是2.0中定义的一个选择器,名为子对象选择符。

但IE6不支持,而FF之类标准浏览器是支持的,因此你看注释,有一句:!IE6.0。
复制内容到剪贴板
代码:
div>b{color:red;}
...
<div>
    <b>我是div的子元素,变为红色</b>
    <span>
         <b>我不是div的子元素,所以不受影响</b>
    </span>
</div>

作者: yoom   发布时间: 2011-01-21