HTML DOM中的Style columnRuleWidth属性用于定义或确定列之间的规则宽度。
用法:
它返回columnRuleWidth属性。object.style.columnRuleWidth
它用于设置columnRuleWidth属性。object.style.columnRuleWidth = "medium|thin|thick|length|
initial|inherit"
属性值:
thin:它用于在列之间设置精简规则。
medium:它用于在列之间创建中等宽度的规则。这是默认宽度。
thick:它在列之间创建一个粗细宽度规则。
length:用于按长度设置宽度。它不取负值。
initial:它用于将columnRuleWidth属性设置为其默认值。
inherit:此属性是从其父级继承的。
返回值:它返回一个表示元素的column-rule-width属性的字符串。
范例1:本示例描述了length属性值。
HTML | DOM Style columnRuleWidth Property
#GFG {
/* For old Chrome and Safari browsers */
-webkit-column-count:4;
-webkit-column-rule:1px green solid;
/* For Firefox browser */
-moz-column-count:4;
-moz-column-rule:1px green solid;
-webkit-column-count:4;
-webkit-column-rule:1px green solid;
text-align:justify;
}
Prepare for the Recruitment drive of product
based companies like Microsoft, Amazon, Adobe
etc with a free online placement preparation
course. The course focuses on various MCQ's
& Coding question likely to be asked in the
interviews & make your upcoming placement
season efficient and successful.
Click on the button to change the
column-rule width
Click Here!
function myGeeks() {
document.getElementById("GFG").style.columnRuleWidth
= "10px";
}
输出:
之前单击按钮:
单击按钮后:
范例2:本示例描述中等属性值。
HTML | DOM Style columnRuleWidth Property
#GFG {
/* For old Chrome and Safari browsers */
-webkit-column-count:4;
-webkit-column-rule:1px green solid;
/* For Firefox browser */
-moz-column-count:4;
-moz-column-rule:1px green solid;
-webkit-column-count:4;
-webkit-column-rule:1px green solid;
text-align:justify;
}
Prepare for the Recruitment drive of product
based companies like Microsoft, Amazon, Adobe
etc with a free online placement preparation
course. The course focuses on various MCQ's
& Coding question likely to be asked in the
interviews & make your upcoming placement
season efficient and successful.
Click on the button to change the
column-rule width
Click Here!
function myGeeks() {
document.getElementById("GFG").style.columnRuleWidth
= "medium";
}
输出:
之前单击按钮:
单击按钮后:
支持的浏览器:下面列出了DOM Style columnRuleStyle属性支持的浏览器:
谷歌浏览器
Firefox使用MozColumnRuleWidth
IE浏览器
Opera
苹果Safari