这篇文章主要为大家展示了“html中如何使用position”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“html中如何使用position”这篇文章吧。
<html>
<head>
<title>day03.html</title>
<styletype="text/css">
/*首先写一个position的div*/
#car{
width:150px;height:30px;
background:#999999;
color:white;text-align:center;
line-height:30px;margin:232px300px;
border:1pxsolidblack;position:relative;
}
#num{
width:20px;height:20px;background:red;
color:white;text-aligh:center;
line-height:20px;position:absolute;
top:-15px;left:25px;
}
</style>
</head>
<body>
<divid="car">
去购物车付款
<divid="num">0</div>
</div>
</body>
</html>
以上是“html中如何使用position”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注云搜网行业资讯频道!