簡體   English   中英

如何創建文本框六邊形邊框?

[英]How to create Textbox Hexagon border?

  • 我想設置文本框邊框像六邊形
  • 我有設計來創建類似的東西。 我的代碼:

 #example1 { border: 2px solid red; padding: 10px; border-radius: 25px; } 
 <div id="example1"> <p>The border-radius property defines the radius of the element's corners.</p> </div> 

像這樣創建邊框

這是一個有多種背景的想法:

 input { width:300px; height:50px; padding:5px; box-sizing:border-box; border:none; outline:0; background: linear-gradient(grey,grey) top /calc(100% - 30px) 1px, linear-gradient(grey,grey) bottom/calc(100% - 30px) 1px, linear-gradient(grey,grey) left /1px calc(100% - 30px), linear-gradient(grey,grey) right /1px calc(100% - 30px), linear-gradient(to bottom right, transparent calc(50% - 1px),grey,transparent calc(50% + 1px)) top left/15px 15px, linear-gradient(to bottom right, transparent calc(50% - 1px),grey,transparent calc(50% + 1px)) bottom right/15px 15px, linear-gradient(to bottom left, transparent calc(50% - 1px),grey,transparent calc(50% + 1px)) top right/15px 15px, linear-gradient(to bottom left, transparent calc(50% - 1px),grey,transparent calc(50% + 1px)) bottom left/15px 15px; background-repeat:no-repeat; } 
 <input type="text"> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM