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.

enter image description here

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; } 

link

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; } 

demo fiddle


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -