如何使用JavaScript设置右边框的宽度?
要在JavaScript中设置右边框的宽度,请使用borderRightWidth属性。使用此属性设置右边框的宽度。
示例
您可以尝试运行以下代码,以了解如何使用JavaScript设置右边框的宽度。
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: thick solid blue;
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<div id = "box">Demo Text</div>
<br><br>
<button type="button" onclick="display()">Change right border width</button>
<script>
function display() {
document.getElementById("box").style.borderRightWidth = "10px";
}
</script>
</body>
</html>热门推荐
10 亲戚送行祝福语简短精辟
11 對好友毕业祝福语简短
12 收围巾的祝福语简短
13 新年发给客户祝福语简短
14 新年送老师简短祝福语
15 婚礼亲友祝福语简短幽默
16 哥哥结婚的祝福语简短
17 古风中考祝福语简短
18 小寒健康祝福语大全简短