ตำแหน่ง:ญาติ; คุณสมบัติช่วยให้คุณสามารถวางตำแหน่งองค์ประกอบที่สัมพันธ์กับตำแหน่งปกติได้ คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้ตำแหน่ง CSS:ญาติ;
ตัวอย่าง
<!DOCTYPE html>
<html>
<head>
<style>
div {
position: relative;
left: 20px;
border: 3px solid blue;
}
</style>
</head>
<body>
<h1>Positioning Element</h1>
<div>
div element with position: relative;
</div>
</body>
</html> ผลลัพธ์
