html - Align overflowing images centrally on page -
how align images on demo centrally?
with no overflow on x-axis on page.
want images centered on page + important know, images wider page. image has overflow #wrap element, , 100% wide on page.
html
<div id="wrap"> <p>somecontent here</p> <img src="http://www.placecage.com/1000/500"> <p>some more content here</p> <img src="http://www.placecage.com/1000/500"> below goes footer <p>some footer text</p> <img src="http://www.placecage.com/1000/500"> </div>
css
#wrap { width:200px; margin:0 auto; background:lightblue; }
if want images 100% of page should outside wrap
div need change markup , use wrap
content:
html
<div class="wrap"> <p>somecontent here</p> </div> <img src="http://www.placecage.com/1000/500" /> <div class="wrap"> <p>some more content here</p> </div> <img src="http://www.placecage.com/1000/500" /> <div class="wrap">below goes footer <p>some footer text</p> </div> <img src="http://www.placecage.com/1000/500" />
css
.wrap { width:200px; margin:0 auto; background:lightblue; } body > img{ width: 100%; vertical-align: top; }
Comments
Post a Comment