Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a box shadow to a css generated arrow?

I'm having difficulty adding a box shadow around the outline of the arrow that was generated using border properties. Is there a way to make the box shadow in the shape the same as the arrow instead of a square box?

Here's a jsfiddle.

enter image description here

HTML:

<a class="bx-prev"></a>
<a class="bx-next"></a>

CSS:

.bx-prev, .bx-next {
  border-right: 15px solid green;
  border-bottom: 15px solid green;
  width: 35px;
  height: 35px;
  top: 200px;
  box-shadow: 0 0 10px 0 rgba(0,0,0,0.5);
}
.bx-prev {
  transform: rotate(135deg);
  position: absolute;
  left: 220px;
}
.bx-next {
  transform: rotate(-45deg);
  position: absolute;
  left: 320px;
}
like image 830
TheAmazingKnight Avatar asked Dec 08 '25 06:12

TheAmazingKnight


1 Answers

Try this.

Edit!

.bx-prev, .bx-next {
  border-right: 15px solid green;
  border-bottom: 15px solid green;
  width: 35px;
  height: 35px;
  top: 200px;
  -webkit-filter: drop-shadow(0px 0px 2px rgba(0,0,0,.7));
  filter: drop-shadow(0px 0px 2px rgba(0,0,0,.7));
}
.bx-prev {
  transform: rotate(135deg);
  position: absolute;
  left: 220px;
}
.bx-next {
  transform: rotate(-45deg);
  position: absolute;
  left: 320px;
}
<a class="bx-prev"></a>
<a class="bx-next"></a>
like image 84
PTA Avatar answered Dec 09 '25 19:12

PTA