Last active
March 28, 2016 21:26
-
-
Save JemiloII/b8e87b025da0af416706 to your computer and use it in GitHub Desktop.
Make div with bottom triangle (SO)
This file contains 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
/** | |
* Make div with bottom triangle (SO) | |
* http://stackoverflow.com/questions/12251149/make-div-with-bottom-triangle/ | |
*/ | |
html { background: darkgrey; } | |
.box { | |
box-sizing: border-box; | |
position: relative; | |
width: 200px; | |
height: 50px; | |
background: blue; | |
overflow: hidden; | |
} | |
.box:before { | |
position: absolute; | |
width: 10px; | |
height: 10px; | |
bottom: 0; | |
transform-origin: bottom left; | |
transform: rotate(45deg); | |
background: white; | |
margin: 0px auto; | |
content: '' | |
} | |
.box:hover, .box:hover:before { | |
background: plum; | |
} |
This file contains 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
<!-- content to be placed inside <body>…</body> --> | |
<div class='box'>text goes here... hover me ;)</div> |
This file contains 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
{"view":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment