<!DOCTYPE html>
<html>
<head>
<title>Thuộc tính left khi dùng position relative trong CSS</title>
<style>
#divtong{width:100%; height:300px; background:red;}
#divtong p{width:100px; height:30px; background:green; top:20px; z-index:1; line-height:30px; text-align:center; color:#fff; display: inline-block; margin:0px; padding:0px}
</style>
</head>
<body>
<h1>Thuộc tính left khi dùng position relative trong CSS</h1>
<p>Thuộc tính left trong position relative sẽ canh cạnh trái của phần tử HTML so với cạnh trái của phần tử cha:</p>
<div id="divtong">
<p style="left:10px; position:relative;">left:10px;</p>
<p style="left:50%; position:relative;">left:50%;</p>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Thuộc tính left khi dùng position relative trong CSS</title>
<style>
#divtong{width:100%; height:300px; background:red;}
#divtong p{width:100px; height:30px; background:green; top:20px; z-index:1; line-height:30px; text-align:center; color:#fff; display: inline-block; margin:0px; padding:0px}
</style>
</head>
<body>
<h1>Thuộc tính left khi dùng position relative trong CSS</h1>
<p>Thuộc tính left trong position relative sẽ canh cạnh trái của phần tử HTML so với cạnh trái của phần tử cha:</p>
<div id="divtong">
<p style="left:10px; position:relative;">left:10px;</p>
<p style="left:50%; position:relative;">left:50%;</p>
</div>
</body>
</html>