如何在 JavaScript 中設定列之間的規則的樣式?
使用 columnRuleStyle 屬性來設定規則的樣式。你可以嘗試執行以下程式碼,以 JavaScript 設定列之間的規則樣式 −
示例
<!DOCTYPE html>
<html>
<head>
<style>
#myID {
column-count: 4;
column-rule: 4px dotted yellow;
}
</style>
</head>
<body>
<p>Click below to change style</p>
<button onclick="display()">Change Style 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.columnRuleStyle = "inset";
}
</script>
</body>
</html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP