文章詳情頁
css - 有沒有辦法自定義 border 為 dashed 時的虛線間距?
瀏覽:250日期:2023-08-03 18:23:53
問題描述
CSS 的 border: 1px dashed 樣式太難看了,虛線非常的寬,dotted 也是一樣,間距太窄。
有沒有辦法控制虛線或者點的長度或者間距呢?
問題解答
回答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線條是可以設置間距的。
path { stroke-dasharray: 4; stroke-dashoffset: 22;}回答3:
如果一定要這樣,使用一下背景圖片也是個選擇,切一小片repeat就好了,而且兼容性很好。但如果是豎邊框的話,就稍微麻煩些。
標簽:
CSS
相關文章:
1. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””2. boot2docker無法啟動3. docker-compose中volumes的問題4. docker安裝后出現Cannot connect to the Docker daemon.5. nignx - docker內nginx 80端口被占用6. java - SSH框架中寫分頁時service層中不能注入分頁類7. 關于docker下的nginx壓力測試8. dockerfile - 為什么docker容器啟動不了?9. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值10. docker容器呢SSH為什么連不通呢?
排行榜

網公網安備