Page Widget How to - Avoid Border Overlap








Question

We would like to know how to avoid Border Overlap.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
<!--from  w  w  w. ja v  a2 s .  c o  m-->
div {
  background: gold;
  border-top: 20px solid #172e4e;
  height: 100px;
  position: relative;
  width: 100px;
}

div::after {
  content: "";
  position: absolute;
  bottom: 0;
  top: 0px;
  left: 0;
  right: 0;
  border-right: 20px solid orange;
  border-left: 20px solid orange;
}
</style>
</head>
<body>
  <div></div>
</body>
</html>

The code above is rendered as follows: