
How to Easily Create Arrows in CSS
You can tweak around with the border property and transform in CSS to create chevrons:
.arrow {
display: inline-block;
border: solid #FCA101;
border-width: 0 3px 3px 0;
padding: 3px;
}
.arrow--up { transform: rotate(-135deg); }
.arrow--down { transform: rotate(45deg); }
.arrow--left { transform: rotate(135deg); }
.arrow--right { transform: rotate(-45deg); }
Copied to clipboard!
You can also turn the above example into triangles by changing the border property around a bit:
.triangle-up {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #FCA101;
}
.triangle-down {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #FCA101;
}
.triangle-left {
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #FCA101;
}
.triangle-right {
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #FCA101;
}
Copied to clipboard!
By also combining the above examples with some transforms, you can achieve diagonal triangles:
.diagonal-triangle {
/* Make sure your element is block level. Otherwise you can't transform it. */
display: inline-block;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #FCA101;
transform: rotate(45deg);
}
Copied to clipboard!

Looking to improve your skills? Master CSS from start to finish.

Resource
π More Webtips
Master the Art of Frontend
Access exclusive interactive lessons
Unlimited access to hundreds of tutorials
Remove ads to learn without distractions
Courses

CSS - The Complete Guide (including Flexbox, Grid and Sass)
Including Flexbox, Grid, and Sass
Whether you're learning CSS for the first time or brushing up on your CSS skills and diving even deeper, this course is for you. Every web developer has to know CSS.

The HTML & CSS Bootcamp
From Zero to Expert!
This course covers flexbox, CSS grid, animations, responsive design, and much more! You will find tons of exercises & projects inside this course.

The Creative HTML5 & CSS3 Course
Build Awesome Websites
Learn HTML5 and CSS3 by creating three amazing, well-designed and animated websites from scratch.