Programming Examples
Css code to create 3 different colors box which partially overlapped to each other
White CSS code to create 3 different colors box which partially overlapped to each other. For Sample.
Solution
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
div{
width:150px;
height:150px;
position:absolute;
opacity:.5;
}
.box1{
background:red;
}
.box2{
background:green;
top:50px;
left:50px;
}
.box3{
background:blue;
top:100px;
left:100px;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>
Output/ Explanation: