css底部边框_底部边框(CSS属性)

css底部边框

句法 (Syntax)

border-width ] [ border-width ] [ border-style ] [ border-style ] [ border-color ] | inherit } ; border-color ] | 继承};

描述 (Description)

The border-bottom shorthand property sets border-bottom-width and/or border-bottom-style and/or border-bottom-color to the bottom side of an element simultaneously.

border-bottom简写属性同时将border-bottom-width和/或border-bottom-style和/或border-bottom-color同时设置到元素的底部。

Borders are placed on top of the element’s background.

边框放置在元素背景的顶部。

(Example)

This style rule assigns a 2px blue border to the bottom side of paragraphs within the element with ID "example":

此样式规则为ID为"example"的元素内段落的底部分配2px的蓝色边框:

#example p {
  border-bottom: 2px solid blue;
}

(Value)

Refer to the following individual properties for specific information on allowed and initial values: border-width, border-style, and border-color.

有关允许和初始值的特定信息,请参考以下各个属性: border-widthborder-styleborder-color

Negative length values are illegal.

负长度值是非法的。

As with most shorthand properties, you don’t need to specify all the properties listed, but any omitted properties will revert to their default values. In the case of border-style, if you omit a value no border will show at all, because the default value is none. A border will only be visible as long as the border-style property has been set to something other than none or hidden, or has been restated explicitly after the initial shorthand declaration. Otherwise, no border will show and the border-width will be reset to zero. Therefore, its good practice to specify a value for the border’s style when you’re using shorthand notation.

与大多数速记属性一样,您无需指定所有列出的属性,但是任何省略的属性都将恢复为其默认值。 在border-style的情况下,如果省略一个值,则根本不会显示任何边框,因为默认值为none 。 仅当border-style属性设置为nonehidden以外的其他值,或者在初始速记声明后已明确地重新设置边框时,边框才可见。 否则,将不会显示任何边框,并且border-width将重置为零。 因此,在使用速记符号时,最好为边框的样式指定一个值。

翻译自: https://www.sitepoint.com/border-bottom-css-property/

css底部边框

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值