ใช้ columnRuleColor คุณสมบัติใน JavaScript เพื่อกำหนดสีของกฎ คุณสามารถลองเรียกใช้รหัสต่อไปนี้เพื่อกำหนดสีของกฎระหว่างคอลัมน์ด้วย 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>