Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> HTML

Thuộc tính borderBottomStyle trong HTML DOM Style

Thuộc tính borderBottomStyle đặt hoặc lấy kiểu đường viền dưới: none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset.

Cú pháp

object.style.borderBottomStyle = value

Các giá trị

Giá trịMô tả
noneKhông viền (mặc định).
hiddenGiống none nhưng vẫn chiếm không gian viền.
dottedViền chấm.
dashedViền nét đứt.
solidViền liền.
doubleViền kép.
grooveViền 3D rãnh (ngược ridge).
ridgeViền 3D nổi (ngược groove).
insetViền 3D chìm (ngược outset).
outsetViền 3D nổi lên (ngược inset).
initialĐặt về mặc định.
inheritKế thừa từ cha.

Ví dụ

Thay đổi kiểu viền dưới:

<!DOCTYPE html> <html> <head> <style> 
  #DIV1 { 
    width: 300px; 
    height: 100px; 
    border-bottom: 8px solid dodgerblue; 
    border-bottom-style: groove; 
  } 
</style> 
<script> 
  function changeBottomStyle(){ 
    document.getElementById("DIV1").style.borderBottomStyle = "dashed"; 
    document.getElementById("Sample").innerHTML = "Kiểu viền dưới đã thay đổi"; 
  } 
</script> </head> 
<body> 
<div id="DIV1">VĂN BẢN MẪU</div> 
<p>Nhấn nút để đổi border-bottom-style</p> 
<button onclick="changeBottomStyle()">THAY ĐỔI KIỂU DƯỚI</button> 
<p id="Sample"></p> 
</body> </html>

Kết quả

Viền dưới ban đầu groove:

Thuộc tính borderBottomStyle trong HTML DOM Style

Sau khi nhấn nút: dashed:

Thuộc tính borderBottomStyle trong HTML DOM Style