Skip to content

Instantly share code, notes, and snippets.

@areichman
Created June 7, 2013 14:43
Show Gist options
  • Save areichman/5729764 to your computer and use it in GitHub Desktop.
Save areichman/5729764 to your computer and use it in GitHub Desktop.
CSS play button
.play {
position: relative;
z-index: 1;
width: 100%;
height: 100%;
}
.play:before { /* triangle */
content: "";
display: block;
position: absolute;
z-index: 3;
top: 50%;
left: 50%;
margin-top: -10px;
margin-left: -7px;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 20px solid white;
}
.play:after { /* circle */
content: "";
display: block;
position: absolute;
z-index: 2;
width: 40px;
height: 40px;
top: 50%;
left: 50%;
margin-top: -24px;
margin-left: -24px;
background: rgba(0,0,0,0.5);
border: 4px solid white;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-box-shadow: 0px 0px 10px black;
-moz-box-shadow: 0px 0px 10px black;
box-shadow: 0px 0px 10px black;
}
<div class="play">
<img src="video.jpg" />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment