html - Slider with fixed height and variable width images -


i'm trying create slider fixed height , variable width images. need slider 100% width of page, , responsive browser viewport.

i prefer not use js.

html

<div id="photoframecontainer">   <div id="photoframe">     <div class="imagecontainer"><img id="theimage" src="uploads/picture02.jpg" alt=""></div>     <div class="imagecontainer"><img id="theimage" src="uploads/picture03.jpg" alt=""></div>     <div class="imagecontainer"><img id="theimage" src="uploads/picture04.jpg" alt=""></div>     <div class="imagecontainer"><img id="theimage" src="uploads/picture05.jpg" alt=""></div>     <div class="imagecontainer"><img id="theimage" src="uploads/picture06.jpg" alt=""></div>     <div class="imagecontainer"><img id="theimage" src="uploads/picture07.jpg" alt=""></div>     <div class="imagecontainer"><img id="theimage" src="uploads/picture08.jpg" alt=""></div>   </div> </div> 

fiddle of failed previous attempt

fiddle

this fiddle of previous attempt achieve want, page isn't responsive when browser resized, images overlap , behave not intended.

you can achieve layout simplifying html (btw ids must unique shouldn't use sane id on images) :

demo

<div id="photoframe">     <img class="test" src="" alt="" />     <img class="test" src="" alt="" />     ... </div> 

css :

body, html {     height:100%;     margin:0; }  #photoframe {     white-space:nowrap;     height:50%; } img {     height:100%;     width:auto; } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -