Chạy thử Ví dụ Thuộc tính height trong CSS

Chạy thử Ví dụ Thuộc tính height trong CSS

Chạy thử Ví dụ Thuộc tính height trong CSS

Tự code rồi chạy thử... Chạy Thử
<!DOCTYPE html>
<html>
<head>
<title>Chạy thử Ví dụ Thuộc tính height trong CSS</title>
<style>
* {-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
div {width:24%; margin-right:1%; float:left;height:200px;border:1px solid red; margin-bottom:10px}
p{width:100%; margin:0px; padding:0px; background:green; color:#fff; padding:10px}
span {width:100%; float:left; height:auto; margin-bottom:10px}
</style>
</head>
<body>

  <h1>Chạy thử Ví dụ Thuộc tính height trong CSS</h1>
  
  <span>Dùng để quy định chiều cao của các phần tử HTML như thẻ div, p, img,... bằng đơn vị px, phần trăm, auto, vh (chiều cao màn hình trình duyệt):
  </span>
  
  <div><p style="height:50px">height:50px</p></div>
  
  <div><p style="height:100px">height:100px</p></div>
  
  <div><p style="height:50%">height:50%</p></div>
  
  <div><p style="height:100%">height:100%</p></div>
  
  <div style="">
  <p style="height:100vh">height:100vh (chiều cao màn hình trình duyệt)</p>
  </div>
  
  <div><p style="height:auto">height:auto</p></div>
  
</body>
</html>
Chạy thử Ví dụ Thuộc tính height trong CSS nằm trong bài viết Thuộc tính height trong CSS