Chạy thử Css position fixed

Trình soạn thảo - Chạy thử Css position fixed

Kết quả - Chạy thử Css position fixed

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

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

<span>Css position fixed sẽ cố định thẻ HTML trên màn hình khi cuộn chuột hay không cuộn chuột, khi Css position fixed sẽ canh theo các góc màn hình bao gồm trên, dưới, trái, phải màn hình, đi kèm với css z-index:1111 ở mức cao nhất:</span>

<div></div>
<div></div>
<div></div>
<div></div>

<p style="bottom:10px; right:10px; position: fixed;">bottom:10px;right:10px;</p>

<p style="top:170px; right:10px; position: fixed;">top:170px;right:10px;</p>

<p style="top:170px; left:10px; position: fixed; ">top:170px;left:10px;</p>

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

</body>
</html>