文章詳情頁
css - 有沒有辦法自定義 border 為 dashed 時(shí)的虛線間距?
瀏覽:263日期: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:
如果一定要這樣,使用一下背景圖片也是個(gè)選擇,切一小片repeat就好了,而且兼容性很好。但如果是豎邊框的話,就稍微麻煩些。
標(biāo)簽:
CSS
相關(guān)文章:
1. golang - 用IDE看docker源碼時(shí)的小問題2. html - css氣泡,實(shí)現(xiàn)“倒三角(不知道算不算三角了)”可透明的。3. phpstudy8.1沒集成mysql-front4. java - 如何點(diǎn)擊按鈕,重新運(yùn)行(我是初學(xué)者)?5. 運(yùn)行python程序時(shí)出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯(cuò)誤?6. 我何時(shí)應(yīng)該在Java中使用JFrame.add(component)和JFrame.getContentPane()。add(component)7. 利用IPMI遠(yuǎn)程安裝centos報(bào)錯(cuò)!8. 前端 - @media query 使用出現(xiàn)的問題?9. html5和Flash對(duì)抗是什么情況?10. javascript - 請(qǐng)指條明路,angular的$event,在select中卻是undefined?
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備