CSS arrow

Directly upload the code:
<div class=" box">


<p >Up arrowp>
<div class="to_top">div>
<p >Left arrowp>
<div class="to_left">div>
<p >right arrowp>
<div class="to_right">div>
<p >Down arrowp>
<div class="to_bottom">div>
div>

html

.box {

width: 400px;
height: 100px;
text-align: center;
margin: 50px auto;
}
.box p {
background: pink;
}
/* Up arrow */
.to_top {
width: 0;
height: 0;
border-bottom: 30px solid #f0f;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
/* Left arrow */
.to_left {
width: 0;
height: 0;
border-right: 30px solid #ffd900;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
/* Right arrow */
.to_right {
width: 0;
height: 0;
border-left: 30px solid greenyellow;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
/* Down arrow */
.to_bottom {
width: 0;
height: 0;
border-top: 30px solid skyblue;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}

The final result:
Share a picture

Of course you can adjust the arrow according to your needs Direction, color, size and other parameters. ————————————————

Directly upload the code:

<div class="box">


<p >Up arrowp>
<div class="to_top">div>
<p >Left arrowp>
<div class="to_left">div>
<p >right arrowp>
<div class="to_right">div>
<p >Down arrowp>
<div class="to_bottom">div>
div>

html

.box {

width: 400px;
height: 100px;
text-align: center;
margin: 50px auto;
}
.box p {
background: pink;
}
/* Up arrow */
.to_top {
width: 0;
height: 0;
border-bottom: 30px solid #f0f;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
/* Left arrow */
.to_left {
width: 0;
height: 0;
border-right: 30px solid #ffd900;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
/* Right arrow */
.to_right {
width: 0;
height: 0;
border-left: 30px solid greenyellow;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
/* Down arrow */
.to_bottom {
width: 0;
height: 0;
border-top: 30px solid skyblue;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}

< div class="box" >


<p >Up arrowp>
<div class="to_top">div>
<p >Left arrowp>
<div class="to_left">div>
<p >right arrowp>
<div class="to_right">div>
<p >Down arrowp>
<div class="to_bottom">div>
div>

.box {

width: 400px;
height: 100px;
text-align: center;
margin: 50px auto;
}
.box p {
background: pink;
}
/* Up arrow */
.to_top {
width: 0;
height: 0;
border-bottom: 30px solid #f0f;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
/* Left arrow */
.to_left {
width: 0;
height: 0;
border-right: 30px solid #ffd900;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
/* Right arrow */
.to_right {
width: 0;
height: 0;
border-left: 30px solid greenyellow;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
/* Down arrow */
.to_bottom {
width: 0;
height: 0;
border-top: 30px solid skyblue;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}

Final effect:

Share pictures

Of course, you can adjust the direction, color, size and other parameters of the arrow according to your needs. ————————————————

Leave a Comment

Your email address will not be published.