Style borderBottom 属性

定义和用法
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 | 设置下边框的颜色。 |
浏览器支持
所有主要浏览器都支持 borderBottom 属性。
实例
更改下边框的宽度、样式和颜色:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.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>
