一个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定位,差不多,我有点犯迷糊了,望高手解释一下……
*{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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28