Page Widget How to - Create big alert box with arrow








Question

We would like to know how to create big alert box with arrow.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.arrow_box {<!--from w  w  w .  ja v a  2s. c  om-->
  position: relative;
  background: #000000;
  left:100px;
  padding: 40px;
  width: 280px;
  height: 100px;
  border-radius: 6px;
  -webkit-box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.75);
  box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.75);
  opacity: 0.6;
}

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

.arrow_box:after {
  border-color: rgba(0, 0, 0, 0);
  border-right-color: #000000;
  border-width: 30px;
  top: 50%;
  margin-top: -30px;
}

.logo {
  color: #ddf8c6;
  text-align: center;
  font-size: 44px;
  line-height: 54px;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
</style>
</head>
<body>
  <div class="preview">
    <div class="arrow_box">
      <h1 class="logo">Java2s.com</h1>
    </div>
  </div>
</body>
</html>

The code above is rendered as follows: