How to add bordered triangle over a div tag

Using the initial box with pointer and shadows at http://cssarrowplease.com/ you can restyle them to make the shape you want:

.arrow_box {
  top: 40px;
  position: relative;
  background: #ffffff;
  border: 1px solid #719ECE;  /*set border colour here*/
  width: 200px;
  height: 200px;
  border-radius: 3px;
  -webkit-filter: drop-shadow(0 1px 10px rgba(113, 158, 206, 0.8)); /*set shadow colour  and size here*/
  -moz-box-shadow: 0 1px 10px rgba(113, 158, 206, 0.8);
  filter: drop-shadow(0 1px 10px rgba(113, 158, 206, 0.8));
}

.arrow_box:after,
.arrow_box:before {
  bottom: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.arrow_box:after {
  border-color: rgba(255, 255, 255, 0);
  border-bottom-color: #ffffff;
  border-width: 19px;
  left: 50%;
  margin-left: -19px;
}

.arrow_box:before {
  border-color: rgba(113, 158, 206, 0);
  border-bottom-color: #719ECE;
  border-width: 20px;
  left: 50%;
  margin-left: -20px;
}
<div class="arrow_box">
</div>

if you need to move the arrow further right, then just play with the left for .arrow_box:after and .arrow_box:before

Leave a Comment