HTML用于定义宽度的是,HTML Style columnRuleWidth用法及代码示例

本文详细介绍了HTMLDOM中的Style.columnRuleWidth属性,用于定义列之间的规则宽度。提供了thin, medium, thick以及length等属性值的示例,展示了如何通过JavaScript改变这一属性。文章还列举了该属性在不同浏览器中的兼容情况。
摘要由CSDN通过智能技术生成

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";

}

输出:

之前单击按钮:

e733d116d41b03eba079e51ba7df9292.png

单击按钮后:

a1067640e141d08b228552d0c0f5867e.png

范例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";

}

输出:

之前单击按钮:

e733d116d41b03eba079e51ba7df9292.png

单击按钮后:

689a3a5a499d7d1244282d1573702e73.png

支持的浏览器:下面列出了DOM Style columnRuleStyle属性支持的浏览器:

谷歌浏览器

Firefox使用MozColumnRuleWidth

IE浏览器

Opera

苹果Safari

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值