css在不同浏览器显示效果不同的问题
rczpf 2011-03-18 11:19:48 各位大侠:
写了一个测试页面,代码如下
<html>
<head>
<style type="text/css">
BODY[orient='landscape']{}BODY[orient='landscape'] > .hide-sub-nav {
width:300px;
}
</style>
<script>
function switchcss()
{
alert(document.body.getAttribute("orient"));
document.body.setAttribute("orient","landscape");
}
</script>
</head>
<body>
<button onclick="switchcss()" title="switch" type="button">cccc</button>
<button class=hide-sub-nav id="eeee" name="dddd" value="test" type="button">dddd</button>
</body>
</html>
现在的问题是,如果把BODY[orient='landscape']{}去掉,则在chrome不能正常改变按钮长度。而在ff可以
请问是什么原因?
多谢