扩展边框CSS的长度(Extend length of border css)

编程入门 行业动态 更新时间:2024-10-25 14:24:25
扩展边框CSS的长度(Extend length of border css)

如何扩展超出我文本长度的边框长度? 这是我到目前为止:

color: #8C4600; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-weight: bold; font-size: 15px; border-bottom: 1px solid #D1D1D1;

这是HTML: <li class = "vendors">VENDORS</li>

How do I expand the length of a border past the length of my text? This is what I have so far:

color: #8C4600; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-weight: bold; font-size: 15px; border-bottom: 1px solid #D1D1D1;

This is the HTML: <li class = "vendors">VENDORS</li>

最满意答案

CSS边框放置在HTML元素的边距和填充之间。 如果您希望HTML元素的边框超出该元素的宽度(或高度),则可以向元素添加CSS填充以向外推送边框。

例如,如果您的html为<li class=vendors">VENDORS</li>添加padding:0 10px;如果您的CSS将向左和向右推送边界10px。

CSS borders are placed between the margins and padding of an HTML element. If you want the borders of an HTML element to extend past the width (or height) of that element, you can add CSS padding to the element in order to push the borders outward.

For example, if your html is <li class=vendors">VENDORS</li> adding padding:0 10px; to your CSS would push the borders outwards on the right and left by 10px.

更多推荐

本文发布于:2023-08-07 19:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465944.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边框   长度   CSS   Extend   border

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!