border虚线的间隔
时间: 2023-09-02 19:12:37 浏览: 134
要调整border虚线的间隔,可以使用背景图片的方式。通过设置background-size的数值越大,间距就越大。具体的实现方法如下所示:
```css
.test-border-line {
height: 1px;
background-image: linear-gradient(to right, #E7C737 0%, #28B35B 50%, transparent 0%);
background-size: 14px 1px; // 调整此处数值来调整间距大小
background-repeat: repeat-x;
}
```
在这个例子中,通过设置background-size的宽度值为14px,可以调整border虚线的间隔大小。你可以根据需要调整这个数值以达到你想要的间距大小。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [css设置border 虚线线框,线之间的间距](https://blog.csdn.net/weixin_44241694/article/details/105581434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [自定义 border(dashed)虚线的间距](https://blog.csdn.net/weixin_44781484/article/details/102385571)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [CSS border虚线边框属性教程](https://download.csdn.net/download/weixin_38618315/12891503)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文