<html>
<head>
<style type="text/css">
#a {
position: absolute;
left: 50px;
top: 50px;
color: red
}
#b {
position: fixed;
left: 100px;
top: 100px;
color: blue
}
#c {
position: relative;
left:200px;
color: pink
}
</style>
</head>
<body>
<span id="a">a wgb,nwsmhbs???</span>
<span id="b">b wgb,nwsmhbs???</span>
<span id="c">c wgb,nwsmhbs???</span>
</body>
</html>
本文通过具体的HTML实例,深入探讨了CSS中三种不同的定位方式:绝对定位、固定定位和相对定位。展示了如何使用left、top属性来精确控制元素的位置,并对比了不同定位类型的特点。
3042

被折叠的 条评论
为什么被折叠?



