0

I am making Div with top right arrow and having contents in that.

Just like in the enter image description here

.arrow_box {
   position: relative;
   background: #FFF;
   border: 2px solid #fff;
    box-shadow: 0px 0px 5px #000;
  }
  .arrow_box:after, .arrow_box:before {
   bottom: 100%;
   left: 99%;
   border: solid transparent;
   content: " ";
   height: 0;
   width: 0;
   position: absolute;
   pointer-events: none;
  }

  .arrow_box:after {
   border-color: rgba(136, 183, 213, 0);
   border-bottom-color: #FFF;
   border-width: 15px;
   margin-left: -15px;
  }
  .arrow_box:before {
   border-color: rgba(0, 0, 0, 0);
   border-bottom-color: #FFF;
   border-width: 21px;
   margin-left: -21px;
  }
<div class="arrow_box">DO You Really Want this Feature?</div>

Somehow i can't get my output.

Any Help Would Be Great?

Thank You

  • To make the drop shadow for your arrow, have a look at this: http://stackoverflow.com/questions/21133763/webkit-filter-drop-shadow-for-other-browsers – Pete Mar 09 '17 at 11:40

1 Answers1

0

body {
  padding: 3em;
  font-family: sans-serif;
}

.arrow_box {
  position: relative;
  background-color: #fff;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
  padding: 1em 2em;
  color: #aaa;
}

.arrow_box::after,
.arrow_box::before {
  content: "";
  background-color: #fff;
  position: absolute;
  top: 0;
  left: 100%;
  height: 1em;
  width: 1em;
  box-shadow: 0 0 10px rgba(0, 0, 0, .5);
  transform-origin: center center;
  transform: translate(-2em, -.5em) rotate(45deg);
  z-index: -1;
}

.arrow_box::before {
  z-index: 1;
  box-shadow: none;
}
<div class="arrow_box">DO You Really Want this Feature?</div>
Andrei Fedorov
  • 3,689
  • 2
  • 13
  • 25