如何使用JavaScript设置右上角的边框形状?
要在JavaScript中设置右上角的边框形状,请使用borderTopRightRadius 属性。使用此属性设置边界半径。
示例
您可以尝试运行以下代码,以了解如何使用JavaScript设置右上边框的形状。
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: thick solid gray;
width: 300px;
height: 200px
}
</style>
</head>
<body>
<div id="box">Demo Text</div>
<br><br>
<button type="button" onclick="display()">Change top right border radius</button>
<script>
function display() {
document.getElementById("box").style.borderTopRightRadius = "20px";
}
</script>
</body>
</html>热门推荐
10 红包祝福语简短网名
11 关于早晨的祝福语简短
12 公司个人新年祝福语简短
13 春节拜年祝福语儿童简短
14 生日祝福语短句简短霸气
15 小朋友祝福语简短的话
16 恭喜新郎父母简短祝福语
17 给孙子祝福语简短独特
18 朋友节最简短祝福语