Page Widget How to - Change border default paint sequence: top border appears over left border








Question

We would like to know how to change border default paint sequence: top border appears over left border.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.container {<!--  w  w w .  jav a 2s .com-->
  height: 100px;
  width: 100px;
  position: relative;
}

.container {
  border-top: 3px solid blue;
  border-left: 0;
  position: relative;
}

.container:before {
  content: "\00a0";
  border-left: 20px solid red;
  height: 100%;
  position: absolute;
  top: -1px;
}
</style>
</head>
<body>
  <div class="container"></div>
</body>
</html>

The code above is rendered as follows: