Page Widget How to - Create four Circles








Question

We would like to know how to create four Circles.

Answer


<!-- w  w  w .  j  av a  2s .  co m-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.overallContainer {
    display: block;
    padding: 2px;
    border: solid 1px gray;
    width: 60px;
    float: left;
    margin: 5px;
}
.circleContainerLeft {
    width: 12px;
    height: 12px;
    padding: 8px;
    margin: 0;
}
.circleContainerRight {
    width: 12px;
    height: 12px;
    padding: 8px;
    margin: -28px 0 0 30px;
}
.circle {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 17px;
    color: #fff;
    line-height: 20px;
    text-align: center;
    background: red;
    margin: -4px 0 0 -4px;
}
.circle span {
    font-size: 14px;
    font-weight: bold;
}
.blue {
    background: blue;
}
.red {
    background: red;
}
.green {
    background: green;
}
.orange {
    background: orange;
}
  </style>
</head>
<body>
  <div class="overallContainer">
    <div class="circleContainerLeft">
        <div class="circle blue"> <span>1</span>
        </div>
    </div>
    <div class="circleContainerRight">
        <div class="circle red"> <span>2</span>
        </div>
    </div>
    <div class="circleContainerLeft">
        <div class="circle green"> <span>3</span>
        </div>
    </div>
    <div class="circleContainerRight">
        <div class="circle orange"> <span>4</span>
        </div>
    </div>
</div>
</body>
</html>

The code above is rendered as follows: