Created
November 15, 2012 14:57
-
-
Save fff/4079032 to your computer and use it in GitHub Desktop.
A CodePen by fff. how to draw one triangle with div - draw a triangle only with css+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
.aa | |
.a | |
.a.b | |
.a.b.c | |
.a.b.c.d | |
.a.b.c.d.e | |
.clear | |
.label "thin boader div" | |
.label "fat boader div" | |
.label "div with 3 boaders" | |
.label2 "0 size div" | |
.label2 "div with 2 boaders" | |
.label2 "triangle" |
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{ | |
display: inline-block; | |
margin: 10px; | |
} | |
.label{ | |
width: 100px; | |
} | |
.label2{ | |
width: 80px; | |
} | |
.clear{ | |
display: block; | |
} | |
.aa{ | |
border: black solid 10px; | |
height: 80px; | |
width: 80px; | |
} | |
.a{ | |
border: black solid 40px; | |
height: 20px; | |
width: 20px; | |
} | |
.b{ | |
border-right: transparent solid 40px; | |
} | |
.c{ | |
height: 0px; | |
width: 0px; | |
} | |
.d{ | |
border-left: transparent solid 40px; | |
} | |
.e{ | |
border-top: transparent solid 40px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment