Page Widget How to - Create CSS Down Triangle








Question

We would like to know how to create CSS Down Triangle.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!--from  ww  w . j av a 2 s .c  o  m-->
  padding: 30px;
}

.triangle {
  display: block;
  margin: 0 0 20px 0;
  width: 0;
  height: 0;
  border-top: 20px solid #008dcd;
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
}
</style>
</head>
<body>
  <span class="triangle"></span>
</body>
</html>

The code above is rendered as follows: