Reputation: 238
I am having problem, aligning the div on 3rd box, Result will be like below.
HTML
<div class="hbox">
<div class="h1"></div>
<div class="h2"></div>
<div class="h3"></div>
</div>
CSS
.hbox
{
float: left;
width: 323px;
height: 188px;
margin: 88px 0 0 5px;
background:url("http://oi59.tinypic.com/96j3g0.jpg") no-repeat;
}
.h1
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#000;}
Upvotes: 0
Views: 66
Reputation: 646
try this
.hbox {
float: left;
width: 323px;
height: 188px;
margin: 88px 0 0 5px;
background: url("http://oi59.tinypic.com/96j3g0.jpg") no-repeat;
position: relative;
}
.hbox:before {
background: none repeat scroll 0 0 #fff;
content: "";
height: 115px;
left: 27px;
position: absolute;
top: 58px;
width: 282px;
z-index: 10;
}
.h1 {
float: left;
position: relative;
width: 62px;
height: 62px;
border-radius: 100%;
left: 79px;
top: 24px;
z-index: 2;
background: #000;
}
.h2 {
float: left;
position: relative;
width: 62px;
height: 62px;
border-radius: 100%;
left: 79px;
top: 24px;
z-index: 2;
background: #ccc;
}
.h3 {
float: left;
position: relative;
width: 62px;
height: 62px;
border-radius: 100%;
left: 79px;
top: 24px;
z-index: 2;
background: #ff0000;
}
<div class="hbox">
<div class="h1"></div>
<div class="h2"></div>
<div class="h3"></div>
</div>
Upvotes: 1
Reputation: 2419
try pseudo-element :before
his code DEMO
.hbox
{
float: left;
width: 323px;
height: 188px;
margin: 88px 0 0 5px;
background:url("http://oi59.tinypic.com/96j3g0.jpg") no-repeat;
position:relative;
}
.hbox:before {
background: none repeat scroll 0 0 #fff;
content: "";
height: 115px;
left: 27px;
position: absolute;
top: 58px;
width: 282px;
z-index: 10;
}
.h1
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#000;}
.h2
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#ccc;}
.h3
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#ff0000;}
Upvotes: 1