+ -
当前位置:首页 → 问答吧 → 一个div+css问题

一个div+css问题

时间:2011-08-08

来源:互联网

先贴代码:<style type="text/css"><!--
*{margin:0px;}
#all{width:300px;height:200px;margin-left:50px;background-color:#666;}


#one{width:50px;height:50px;background-color:#000;}


#two{ width:100px; height:50px; background-color:#6C0; position: fixed; top: 100px; }
-->
</style>




</head>








<body>
<div id="all">
<div id="one">第一个</div>
<div id="two">第二个</div>
</div>


</body>
</html>


我想问的是:第二个设置了fixed的属性之后无论如何改变top或者left、right属性,第二个就是不动,书上说跟absolute定位,差不多,我有点犯迷糊了,望高手解释一下……

作者: syf   发布时间: 2011-08-08

怎么没人来解释一下呢?

作者: syf   发布时间: 2011-08-09