csscss-shapes

Hexagon shape with CSS3


Can such a hexagon be created with pure CSS3?

enter image description here

Thanks for any help!


Solution

  • A simple search turned this up: CSS Hexagon Tutorial

    Referenced from the site:

    Put a 104px × 60px div with a background colour between them and you get (the hexagon):

    width: 0;
    border-bottom: 30px solid #6C6;
    border-left: 52px solid transparent;
    border-right: 52px solid transparent;
    
    width: 104px;
    height: 60px;
    background-color: #6C6;
    
    width: 0;
    border-top: 30px solid #6C6;
    border-left: 52px solid transparent;
    border-right: 52px solid transparent;