-2

I wanna do this shape using css

enter image description here

Any sugestion?

Ezequiel
  • 7
  • 1

1 Answers1

2

You can use CSS clip-path

div {
  height: 100px;
  width: 100px;

  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  
  background: #ccc;
}
<div></div>
Magiczne
  • 1,586
  • 2
  • 15
  • 23
  • 1
    Be careful though. A regular hexagon with equal side lenghts and the width `w` (as diagonal) has the height `sqrt(3)/2*w` In this example, the height should be defined as `86.6px`. – andreas Nov 23 '20 at 16:43