文章詳情頁
css - 有沒有辦法自定義 border 為 dashed 時的虛線間距?
瀏覽:196日期:2023-08-03 18:23:53
問題描述
CSS 的 border: 1px dashed 樣式太難看了,虛線非常的寬,dotted 也是一樣,間距太窄。
有沒有辦法控制虛線或者點(diǎn)的長度或者間距呢?
問題解答
回答1:Displays a series of short square-ended dashes or line segments. The exact size and length of the segments are not defined by the specification and are implementation-specific.
——MDN
囧,看來沒好辦法。不過你可以用圖片作邊框用。
回答2:沒有辦法。
但SVG線條是可以設(shè)置間距的。
path { stroke-dasharray: 4; stroke-dashoffset: 22;}回答3:
如果一定要這樣,使用一下背景圖片也是個選擇,切一小片repeat就好了,而且兼容性很好。但如果是豎邊框的話,就稍微麻煩些。
標(biāo)簽:
CSS
相關(guān)文章:
1. css3選擇器nth-of-type的問題2. docker - dcoker gitlab 如何修改主機(jī)地址?3. Html 入門教程視頻無法播放4. javascript - 微信jssdk ios下自定義onMenuShareAppMessage 分享失效,Android分享成功5. PHP單例模式6. css3 - css 選擇器如何同時使用屬性選擇和順序選擇?7. objective-c - 微信支付的問題8. angular.js - 請教一個關(guān)于angularjs的小問題9. html調(diào)整想要的文字大小和位置10. angular.js - angularjs的自定義過濾器如何給文字加顏色?
排行榜

熱門標(biāo)簽