Home > Web Front-end > CSS Tutorial > How to draw a double arrow with pure CSS (code example)

How to draw a double arrow with pure CSS (code example)

青灯夜游
Release: 2021-05-21 09:30:29
forward
2654 people have browsed it

This article will introduce to you how to draw a double arrow effect using pure CSS. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

How to draw a double arrow with pure CSS (code example)

(Learning video sharing: css video tutorial)

1. Call a single arrow multiple times

After realizing a single arrow~~ it is easy to realize a double arrow. Two principles for realizing a single arrow have been introduced above: frame rotation method and double triangle coverage method. This time, we take border rotation as an example and call it multiple times to implement double arrows.

1. Frame rotation single arrow implementation

.arrow-right{
  height: 120px;
  width: 30px;
  display :inline-block;
  position: relative;
}
.arrow-right::after {
  content: "";
  height: 60px;
  width: 60px;
  top: 12px;
  border-width: 8px 8px 0 0;
  border-color: blue;
  border-style: solid;
  transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  position: absolute;
}
Copy after login

The rendering is as follows:
How to draw a double arrow with pure CSS (code example)
2. Multiple calls to the single arrow

<div>
	<span class="arrow-right"/>
    <span class="arrow-right"/>
</div>
Copy after login

The rendering is as follows:
How to draw a double arrow with pure CSS (code example)

2. Draw double arrows directly

Before drawing a single arrow through the ::after pseudo-element, now Add the ::before pseudo-element and draw a single arrow to realize drawing a double arrow using pure CSS.

.arrow-right{
  height: 120px;
  width: 30px;
  display :inline-block;
  position: relative;
}
.arrow-right::before {
  content: "";
  height: 60px;
  width: 60px;
  top: 12px;
  left: 30px;
  border-width: 8px 8px 0 0;
  border-color: blue;
  border-style: solid;
  transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  position: absolute;
}
.arrow-right::after {
  content: "";
  height: 60px;
  width: 60px;
  top: 12px;
  border-width: 8px 8px 0 0;
  border-color: blue;
  border-style: solid;
  transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  position: absolute;
}
Copy after login

The rendering is as follows:
How to draw a double arrow with pure CSS (code example)
The double triangle overlay method can also draw double arrows directly, but it is more troublesome to implement. It is not as easy to implement as the border rotation method, so I won’t go into it.

For more programming-related knowledge, please visit: Programming Teaching! !

The above is the detailed content of How to draw a double arrow with pure CSS (code example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template