天天看點

Style borderBottom 屬性

Style 對象

定義和用法

borderBottom 屬性以速記形式設定或傳回三個獨立的下邊框屬性。

通過該屬性,您可以設定/傳回:

  • border-bottom-width
  • border-bottom-style
  • border-bottom-color

文法

設定 borderBottom 屬性:

Object.style.borderBottom="width style color"

傳回 borderBottom 屬性:

Object.style.borderBottom

提示:

borderBottom 屬性沒有預設值。

參數 描述
width 設定下邊框的寬度。
style 設定下邊框的樣式。
color 設定下邊框的顔色。

浏覽器支援

Style borderBottom 屬性
Style borderBottom 屬性
Style borderBottom 屬性
Style borderBottom 屬性
Style borderBottom 屬性

所有主要浏覽器都支援 borderBottom 屬性。

執行個體

更改下邊框的寬度、樣式和顔色:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>菜鳥教程(runoob.com)</title>

<style type="text/css">

#ex1{

    border: thin dotted #FF0000;

}

</style>

<script>

function displayResult(){

    document.getElementById("ex1").style.borderBottom="thick solid #0000FF";

</script>

</head>

<body>

<div id="ex1">這是一些文本。</div>

<br>

<button type="button" onclick="displayResult()">修改底部邊框</button>

</body>

</html>

Style 對象