Skip to content

Instantly share code, notes, and snippets.

@amelieykw
Last active March 30, 2018 14:42
Show Gist options
  • Save amelieykw/bc9b215bec63f5caef11607be3f86cad to your computer and use it in GitHub Desktop.
Save amelieykw/bc9b215bec63f5caef11607be3f86cad to your computer and use it in GitHub Desktop.
[draw arrow of different angles in HTML with CSS] #HTML #CSS #arrow #drawArrow
.arrow {
height: 50px;
position: relative;
width: 30px;
background: black;
margin: 100px;
display: inline-block;
}
.arrow:before {
content: " ";
width: 20px;
background: black;
height: 45px;
position: absolute;
top: -15px;
transform: rotate(50deg);
left: -5px;
}
.arrow:after {
content: " ";
width: 20px;
background: black;
height: 45px;
position: absolute;
top: -15px;
transform: rotate(-50deg);
right: -5px;
}
.left {
transform: rotate(-90deg);
}
.right {
transform: rotate(90deg);
}
.half-left {
transform: rotate(-45deg);
}
.half-right {
transform: rotate(45deg);
}
<div class="arrow"> </div>
<div class="arrow left"> </div>
<div class="arrow right"> </div>
<div class="arrow half-left"> </div>
<div class="arrow half-right"> </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment