Place the div in the center of the viewport with position:absoluteand top:50%; left:50%; transform: translate(-50%, -50%).
and using elements before and after elements with rotate(60deg)and rotate(-60deg).
setting divs box-sizing: border-box; border:1px solid blue; height:40px;and 20*2*3^(1/2)it seems 69.28xxxxxxx, so I set the width as such.
but the result seems to be that there are some fuzzy pixels at the border crossing point. I do not know how to fix this.
browser: chrome Editor: bracket
http://jsfiddle.net/gonejack/hYN67/
source
share