This is the layout I am looking for to achieve:

I created a hexagon with this css:
.hexagon {
width: 100px;
height: 55px;
background: red;
position: relative;
display:inline-block;
margin:0.2em;
}
.hexagon:before {
content: "";
position: absolute;
top: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 25px solid red;
}
.hexagon:after {
content: "";
position: absolute;
bottom: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 25px solid red;
}
However, I am looking to learn how to fill them with an image. Here is the pen: https://codepen.io/1istbesser/pen/ddypXK
How to place images inside a hexagon so that it covers all this? If I use the background image on # hexagon1, the image only covers the middle part.
source
share