Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hexagon shape with CSS3

Tags:

css

css-shapes

Can such a hexagon be created with pure CSS3?

enter image description here

Thanks for any help!

like image 278
cycero Avatar asked Jul 27 '13 10:07

cycero


People also ask

How do you make a hexagon shape in CSS?

We can make a curved edge hexagon by using the pseudo-element property of CSS. Use a div element to create a rectangle and also add border-radius to it. Now create a pseudo-element after using CSS and rotate it by using 60deg. Also create another pseudo-element before by using CSS and rotate it by -60deg.

How do I create a hexagon image in CSS3?

Using rotate() method of CSS3 transform to create a hexagonal shaped structure with an image inside it. Adjust the box-shadow to hide out the excess of the hexagon structure with the background color ie., in the example white.

Can you make shapes in CSS?

In this article, we will design some different types of shapes using CSS. CSS is capable of making all types of shapes.

How do I create a polygon shape in CSS?

The polygon() function is an inbuilt function in CSS which is used with the filter property to create a polygon of images or text. Syntax: polygon( percentage | length); Parameter: This function accepts two parameter percentage or length which is used to hold the value of polygon size.


1 Answers

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;
like image 103
Kyle Yeo Avatar answered Nov 08 '22 20:11

Kyle Yeo