Page Widget How to - Fill div element with border








Question

We would like to know how to fill div element with border.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.d1 {<!--  w w  w  .  ja v  a  2  s.co  m-->
  height: 0;
  width: 0;
  background: #eee;
  border-style: solid;
  border-color: blue red;
  border-width: 30px;
  margin-top: 20px;
}
</style>
</head>
<body>
  <div class="d1"></div>
</body>
</html>

The code above is rendered as follows: