如何使用JavaScript设置列之间的规则宽度?
使用columnRuleWidth属性设置列之间的宽度。您可以尝试运行以下代码以使用JavaScript设置列之间的规则宽度-
示例
<!DOCTYPE html>
<html>
<head>
<style>
#myID {
column-count: 4;
column-rule: 4px solid yellow;
}
</style>
</head>
<body>
<p>Click below to change width</p>
<button onclick="display()">Change Width 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.columnRuleWidth = "8px";
}
</script>
</body>
</html>热门推荐
10 虎年文案简短祝福语长辈
11 新年稳重的祝福语简短
12 嫁女儿祝福语女生简短
13 教师同事升职祝福语简短
14 祝愿新生宝宝祝福语简短
15 员工离职祝福语简短高级
16 手写母亲的祝福语简短
17 乘风语文考试祝福语简短
18 给哥嫂结婚祝福语简短