Site Message

Ready to Switch to eZbloo?

Basic eZbloo Plan $15 a month- Perfect for Low traffic and new startups

Premium eZbloo Plan $45 a month- Perfect for High Traffic Sites

Any Questions?: Contact me here!

     


To make an octagon in CSS first we need to set up a div. We are going to give our div an id of octagon.
<div id="octagon"></div>
Next we will insert the style for the octagon in our css stylesheet.
<style>
#octagon {
width: 100px;
height: 100px;
background: gray;
position: relative;
}

#octagon:before {
content: "";
position: absolute;
top: 0;
left: 0;
border-bottom: 29px solid gray;
border-left: 29px solid #eee;
border-right: 29px solid #eee;
width: 42px;
height: 0;
}

#octagon:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
border-top: 29px solid gray;
border-left: 29px solid #eee;
border-right: 29px solid #eee;
width: 42px;
height: 0;
}
</style>
To see more about creating octagons please see CSS tricks.



Sign Up To Comment