To create arrows with CSS, the code is as follows −
Example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
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);
}
</style>
</head>
<body>
<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>
</body>
</html>Output
The above code will produce the following output −
