文章詳情頁
css - 有沒有辦法自定義 border 為 dashed 時的虛線間距?
瀏覽:265日期: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. nignx - docker內nginx 80端口被占用2. docker容器呢SSH為什么連不通呢?3. javascript - 連續點擊觸發mouseleave事件4. docker - 各位電腦上有多少個容器啊?容器一多,自己都搞混了,咋辦呢?5. 關于docker下的nginx壓力測試6. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””7. mac里的docker如何命令行開啟呢?8. docker gitlab 如何git clone?9. dockerfile - 我用docker build的時候出現下邊問題 麻煩幫我看一下10. angular.js使用$resource服務把數據存入mongodb的問題。
排行榜

網公網安備