gpt4 book ai didi

css - 我怎样才能使这个 css 边框属性成为一个衬里?

转载 作者:行者123 更新时间:2023-11-28 09:24:37 25 4
gpt4 key购买 nike

我有这个工作的 css,但我想把它放在一行中,这可能吗?

border-radius: 0;
border-color: #ccc;
border-width: 0 0 2px 0;
border-style: none none solid none;

最佳答案

这篇简短的文章涵盖了您在日常工作中会遇到的各种 CSS 速记。

https://www.w3.org/community/webed/wiki/CSS_shorthand_reference

边框

border 允许您设置border widthstylecolor .

更新:

正如@torazaburo 所指出的,它实际上需要 border: 0 none #ccc 才能正确,还需要添加 border-radius: 0 因为它不是边框速记。

#example {
border: 0 none #ccc;
border-bottom: 2px solid #ccc;
border-radius: 0;
}

如果以下内容可以从级联中的其他规则中获取非底部边框宽度和样式不是问题,那么这应该没问题:

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

生成您想要的相同 CSS:

https://jsfiddle.net/betg5xue/5/

关于css - 我怎样才能使这个 css 边框属性成为一个衬里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37336274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com