如何使用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 姨父生日祝福语简短精辟