How to create arrows with CSS?

CSSWeb DevelopmentFront End Technology

To create arrows with CSS, the code is as follows −


 Live Demo

<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1" />
   body {
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
      padding: 20px;
   i {
      border: solid rgb(62, 19, 182);
      border-width: 0 6px 6px 0;
      display: inline-block;
      padding: 3px;
   p {
      font-size: 18px;
      font-weight: 500;
   .rightArrow {
      transform: rotate(-45deg);
   .leftArrow {
      transform: rotate(135deg);
   .upArrow {
      transform: rotate(-135deg);
   .downArrow {
      transform: rotate(45deg);
<h2>CSS Arrows</h2>
<p>Right arrow: <i class="rightArrow"></i></p>
<p>Left arrow: <i class="leftArrow"></i></p>
<p>Up arrow: <i class="upArrow"></i></p>
<p>Down arrow: <i class="downArrow"></i></p>


The above code will produce the following output −

Published on 08-May-2020 14:12:03