如何使用JavaScript设置列规则属性?
该columnRule属性在JavaScript中使用设置列规则。它使您可以设置列规则之间的样式,颜色和宽度。
示例
您可以尝试运行以下代码以使用JavaScript设置列规则属性-
<!DOCTYPE html>
<html>
<body>
<p>Click below to create 4 columns</p>
<button onclick="display()">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.columnCount = "4";
document.getElementById("myID").style.columnRule = "2px outset red";
}
</script>
</body>
</html>热门推荐
10 同事离别祝福语简短的
11 领证幽默祝福语简短
12 祝福语简短古诗词
13 婆婆生日祝福语简短的
14 给老师祝福语简短创意
15 新年祝福语简短聪明可爱
16 祖国七十华诞简短祝福语
17 离别简短的祝福语大全
18 给孙子拜年祝福语简短