Positioning in HTML/CSS? -


here html code:

<div id="slider" class="images"> <img src="img/image1.png" height=200 width=200>     <p>image1 corresponding text here</p>     <img src="img/image2.png" height=200 width=200>     <p>image2 corresponding text here</p>     <img src="img/image3.png" height=200 width=200>     <p>image3 corresponding text here</p>     

<div class="switch_image"> <a href="#" id="prev">prev</a> <a href="#" id="next">next</a> 

  1. how can change text location to right of image , not below it?
  2. after above question answered, images stacked on top of each other, how can space images apart margin?
  3. once done, how can each image , it's corresponding text move respect original position when re-size broswer window?

i'd suggest wrapping images , text:

<div id="slider" class="images">     <div class="single-image">         <img src="img/image1.png" height=200 width=200>         <p>image1 corresponding text here</p>        </div>      <div class="single-image">         <img src="img/image1.png" height=200 width=200>         <p>image1 corresponding text here</p>        </div>      <div class="single-image">         <img src="img/image1.png" height=200 width=200>         <p>image1 corresponding text here</p>        </div> </div> 

then in css like:

.images { overflow: hidden; /* dirty way of self-clearing floats */ }  .single-image {      overflow: hidden;     float: left;     margin: 10px;     width: 300px; }  .single-image img {      float: left; }  .single-image p {     float: right;     width: 90px; } 

example: http://jsbin.com/alobiw/1/edit


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -