Page Widget How to - Embellish a Border with a pseudo-element








Question

We would like to know how to embellish a Border with a pseudo-element.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
h2 {<!--from   ww  w .  j  av a  2 s .co m-->
  line-height: 17px;
  padding-bottom: 15px;
  text-transform: uppercase;
  border-bottom: 2px solid #00a7a8;
  position: relative;
}

h2:before {
  content: '\25bc';
  position: absolute;
  top: 100%;
  left: 5em;
  color: #00a7a8;
}
</style>
</head>
<body>
  <h2>The Header Is Here</h2>
</body>
</html>

The code above is rendered as follows: