Reputation: 47
Is it possible to have a wrapper that have a width of 1000px;
but on the same time i want a DIV inside that DIV, to be 100%
width
Is that possible by any chance.
My code is something like this
<div class="block1">
<img src="images/page1-img2.jpg" alt="" class="img-radius">
<div class="border-1">
<p class="color-1">Security Systems for Office</p>
<p>Facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod.</p>
<a href="#" class="button top-1">Read More</a>
</div>
</div>
Around this i want another div, that is width:100%
even that my wrapper is only 1000px
;
Upvotes: 0
Views: 88
Reputation: 44150
It's possible - assuming no parent elements are positioned non-statically - but you'll have to position the inner div absolutely:
#inner {
position: absolute;
height: 150px;
left: 0;
right: 0;
background: blue;
}
#wrap {
width: 300px;
height: 300px;
margin-left: 50px;
background: red;
}
<div id="wrap"><div id="inner"></div></div>
It's worth noting that I would generally try and avoid situations like this unless you really have to because it's kinda counter-intuitive.
Upvotes: 2