如何使用JavaScript设置列之间的规则颜色?
使用JavaScript中的columnRuleColor属性设置规则的颜色。您可以尝试运行以下代码以使用JavaScript设置列之间的规则颜色-
示例
<!DOCTYPE html>
<html>
<head>
<style>
#myID {
column-count: 4;
column-rule: 4px outset yellow;
}
</style>
</head>
<body>
<p>Click below to change color</p>
<button onclick="display()">Change Color between Columns</button>
<div id="myID">
This is demo text. This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text. This is demo text.
</div>
<script>
function display() {
document.getElementById("myID").style.columnRuleColor = "red";
}
</script>
</body>
</html>热门推荐
10 简短有内涵的祝福语
11 要过年了祝福语简短
12 周二祝福语大全简短
13 白羊生日祝福语 简短独特
14 简短新婚铺被子祝福语
15 对别人新年祝福语简短
16 圣诞简短祝福语给父母
17 道教生日祝福语简短大全
18 新年祝福语简短创意兄弟