Last active
October 14, 2015 14:17
-
-
Save Loiree/145897eacab360600d89 to your computer and use it in GitHub Desktop.
Hexagon on CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hex"> | |
<div class="hex-part"> | |
<div class="hex-cont"> | |
<p>content</p> | |
</div> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hex | |
width 200px | |
height 100px | |
transform rotate(120deg) | |
position relative | |
overflow hidden | |
visibility hidden | |
display block | |
text-decoration none | |
.hex-part | |
width 100% | |
height 100% | |
transform rotate(-60deg) | |
overflow hidden | |
.hex-cont | |
width 100% | |
height 100% | |
background orange | |
transform rotate(-60deg) | |
text-align center | |
visibility visible | |
// Для смены вида нужно высоту и ширину поменять местами | |
// display block — если встраивать стили к ссылкам и другим неблочным элементам |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment