Chạy thử Css position relative

Chạy thử Css position relative

Chạy thử Css position relative

Tự code rồi chạy thử... Chạy Thử
<!DOCTYPE html>
<html>
<head>
<title>Chạy thử Css position relative</title>
<style>
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
#kchupo{width:100%;float:left;height:300px;background:red}
p{width:170px; height:auto; background:green; padding:10px; color:#fff; margin:0px }
span {width:100%;float:left; height:auto;margin-bottom:10px}
</style>
</head>
<body>

<h1>Chạy thử Css position relative</h1>

<span>Dùng để canh vị trí so với thẻ HTML chứa nó, canh khoảng cách bằng relative  chỉ dùng được top, left còn right, bottom không dùng được. Ngoài ra position relative còn dùng để các thẻ con thực hiện position absolute:</span>

<div id="kchupo">

<p style="bottom:-10px;left:10px; position: relative;">bottom:-10px;left:10px;</p>

<p style="top:150px;left:10px; position: relative;">top:10px;left:10px;</p>

</div>

</body>
</html>
Chạy thử Css position relative nằm trong bài viết Thuộc tính position trong CSS