如何使用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 小年好的祝福语简短