html - Getting Images Inline Horizontally with descriptors -


html/css: trying put set of images in horizontal row on web page.

i getting problem when introduce text descriptor below each picture. result when descriptor large enough needs wrap newline particular image shifts bit.

i have setup in jsfiddle:

http://jsfiddle.net/mapbpk/8rq5n/

here html / css code:

<div class = "pnmpiccontainer" id = "picture" >                 <h3 class="clearfloat"><center><strong>picture palette</strong></center></h3>      <div class = "pnmpicimageslot" id="picslot_0"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - rear.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - rear.jpg"                                 title="oak house - rear.jpg" class = "drag" id = "dropobj_1"/>                     <br>back garden      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_1"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - dining room.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - dining room.jpg"                                 title="oak house - dining room.jpg" class = "drag" id = "dropobj_2"/>                     <br>dining room      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_2"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oakhouse-garden.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oakhouse-garden.jpg"                                 title="oakhouse-garden.jpg" class = "drag" id = "dropobj_3"/>                     <br>large garden      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_3"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - lounge.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - lounge.jpg"                                 title="oak house - lounge.jpg" class = "drag" id = "dropobj_4"/>                     <br>very very spacious living room      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_4"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oh bed 01.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oh bed 01.jpg"                                 title="oh bed 01.jpg" class = "drag" id = "dropobj_5"/>                     <br>main bedroom      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_5"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - bed 2.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - bed 2.jpg"                                 title="oak house - bed 2.jpg" class = "drag" id = "dropobj_6"/>                     <br>bedroom 2      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_6"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - bed 3.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - bed 3.jpg"                                 title="oak house - bed 3.jpg" class = "drag" id = "dropobj_7"/>                     <br>bedroom 3      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_7"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - conservatory.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - conservatory.jpg"                                 title="oak house - conservatory.jpg" class = "drag" id = "dropobj_8"/>                     <br>conservatory      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_8"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - lawn.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - lawn.jpg"                                 title="oak house - lawn.jpg" class = "drag" id = "dropobj_9"/>                     <br>elegant lawn      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_9"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - front.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - front.jpg"                                 title="oak house - front.jpg" class = "drag" id = "dropobj_10"/>                     <br>driveway      </div>  <!-- pnmpicimageslot -->        <div class = "pnmpicimageslot" id="picslot_10"                              style="width:145px; height:100px">                              <img src="http://localhost:9000/homevu1//homevu1/pictures/oak house - front 2.jpg"                                 width="56.700000751018464"                                 height="37.800000500678976"                                 alt="oak house - front 2.jpg"                                 title="oak house - front 2.jpg" class = "drag" id = "dropobj_11"/>                     <br>front garden      </div>  <!-- pnmpicimageslot -->                        </div> 

css:

.pnmpiccontainer, .pnmvidcontainer /* mak */ {     background-color: #f0fff0;     /* background-image: url(../images/skin/database_add.png); */     /* background-repeat:repeat-x; */         padding: 1em 1em 1em 1em;     margin: 1em 1em 1em 1em;       width:auto; text-align:center; display:block;    }   .pnmpicimage /* mak */ { font-size: 0.6em; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px; background-color: transparent; border-color: transparent; padding: 1em 1em 1em 1em; }  .pnmpicimageslot , .pnmvidimageslot { /* float:left; */ padding: 5px;  text-transform: none; letter-spacing: normal; /* padding: .3em .1em .2em .1em; */ display:inline-block; /* background-image: url(../images/skin/film0314.png); */  background-color:#a4dded ;    } 

would welcome suggestions?

-mike

the display: inline-block property makes html space sensitive. add 'vertical-align: top' pnmpicimageslot style fix it.

.pnmpicimageslot , .pnmvidimageslot {     /* float:left; */     padding: 5px;      text-transform: none;     letter-spacing: normal;     /* padding: .3em .1em .2em .1em; */     display:inline-block;     vertical-align: top;     /* background-image: url(../images/skin/film0314.png); */      background-color:#a4dded; } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -