Skip to content

Instantly share code, notes, and snippets.

@exarcheia-web
Created January 21, 2014 19:46
Show Gist options
  • Save exarcheia-web/8546999 to your computer and use it in GitHub Desktop.
Save exarcheia-web/8546999 to your computer and use it in GitHub Desktop.
CSS Triangle
/* CSS Triangle */
* { box-sizing: border-box }
.triangle {
width: 0; height: 0;
border-bottom: 50px solid black;
border-left: 20px solid transparent;
border-right: 70px solid transparent;
position: relative;
transition: 1s all;
}
.triangle:hover {
border-bottom: 100px solid black;
border-left: 20px solid transparent;
border-right: 120px solid transparent;
}
.triangle:hover:before {
content: "Hello";
position: absolute;
top: 70px;
left: 0px;
text-align: center;
color: white;
z-index: 99;
}
<div class="triangle"></div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment