Page Widget How to - Create arrow box








Question

We would like to know how to create arrow box.

Answer


<!--<!--  w w w  .j  a  v  a2 s  . c  o  m-->
based on cssarrowplease.com  / https://github.com/hojberg/cssarrowplease
IE8 fix: https://github.com/hojberg/cssarrowplease/issues/39
another approach: http://css-tricks.com/snippets/css/css-triangle/

-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.arrow_box {
  position: relative;
  background: #88b7d5;
}

.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-bottom-color: #88b7d5;
  border-width: 30px;
  left: 50%;
  margin-left: -30px;
}

.arrow_box:before {
  border-bottom-color: #c2e1f5;
  border-width: 36px;
  left: 50%;
  margin-left: -36px;
}

h1 {
  margin: 0;
  padding: 0;
}

.arrow_box {
  border-radius: 10px;
  height: 100px;
  padding: 40px;
  width: 280px;
  margin: 30px;
}
</style>
</head>
<body>
  <div class="arrow_box">
    <h1>CSS ARROW BOX</h1>
  </div>
</body>
</html>

The code above is rendered as follows: