Make a Pentagon in CSS

Make a Pentagon in CSS. Set up a div in your html page and call it pentagon.

[code]<div id="pentagon"></div>[/code]

Next we will style the div in our CSS to create the pentagon.

[code]<style>
#pentagon {
position: relative;
width: 54px;
border-width: 50px 18px 0;
border-style: solid;
border-color: pink transparent;
}
#pentagon:before {
content: "";
position: absolute;
height: 0;
width: 0;
top: -85px;
left: -18px;
border-width: 0 45px 35px;
border-style: solid;
border-color: transparent transparent pink;
}
</style>[/code]

Only cool people share!

Make a Pentagon in CSS

Tear apart this CSS code piece by piece and you will learn better how to Make a Pentagon in CSS. Most coders learn this way in order to understand the syntax better.

Make a Pentagon in CSS was last modified: May 22nd, 2015 by Maximus Mccullough
Summary
Make a Pentagon in CSS
Article Name
Make a Pentagon in CSS
Description
Learn how to make a pentagon in CSS in this very simple tutorial.
Author
create-a-pentagon-with-css

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.