Created
July 12, 2016 10:18
-
-
Save matchilling/654bb35d4579e1959c96583368fcc6b1 to your computer and use it in GitHub Desktop.
Responsive arrows vanilla CSS - https://jsfiddle.net/matchilling/1v4jckwy/
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="wrapper"> | |
<div class="arrow left"> </div> | |
<br /> | |
<div class="arrow right"> </div> | |
</div> | |
<style> | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
.wrapper { | |
max-width: 600px; | |
margin: 0 auto; | |
text-align: center; | |
} | |
.arrow { | |
position: relative; | |
background: #ccc; | |
height: 1px; | |
top: 15px; | |
} | |
.arrow:after, | |
.arrow:before { | |
right: 100%; | |
border: solid transparent; | |
content: ''; | |
height: 0; | |
width: 0; | |
position: absolute; | |
pointer-events: none; | |
} | |
.arrow.left:after, | |
.arrow.left:before { | |
right: 100%; | |
} | |
.arrow.right:after, | |
.arrow.right:before { | |
left: 100%; | |
} | |
.arrow.left:after { | |
border-color: transparent; | |
border-right-color: #ccc; | |
border-width: 5px; | |
margin-top: -5px; | |
} | |
.arrow.left:before, | |
.arrow.right:before { | |
border-color: transparent; | |
border-width: 5px; | |
margin-top: -5px; | |
} | |
.arrow.right:after, | |
.arrow.right:before { | |
border-left-color: #ccc; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment