I am trying to make the "box-left-mini" go in front of the div
which is below.
<div class="box-left-mini"> this div is infront <div style="background-image:url(/images/hotcampaigns/campaign-sample.png);height:100px;width:100px;"> this div is behind </div> </div>
The CSS for box-left-mini
is:
.box-left-mini { float:left; background-image:url(website-content/hotcampaign.png); width:292px; height:141px; }
http://jsfiddle.net/f2znvn4f/
HTML
<div class="box-left-mini"> <div class="front"><span>this is in front</span></div> <div class="behind_container"> <div class="behind">behind</div> </div> </div>
CSS
.box-left-mini{ float:left; background-image:url(website-content/hotcampaign.png); width:292px; height:141px; } .box-left-mini .front { display: block; z-index: 5; position: relative; } .box-left-mini .front span { background: #fff } .box-left-mini .behind_container { background-color: #ff0; position: relative; top: -18px; } .box-left-mini .behind { display: block; z-index: 3; }
The reason you're getting so many different answers is because you've not explained what you want to do exactly. All the answers you get with code will be programmatically correct, but it's all down to what you want to achieve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With