CSS - Images cascading down and not aligning horizontally -


i trying align images horizontally there weird cascading down effect. how can solve this?

html (drupal)

<div class="view-content">   <div class="views-row views-row-1 views-row-odd views-row-first">       <div class="views-field views-field-title">                 <span class="field-content"><a href="/country">up country</a></span>         </div>         <div class="views-field views-field-field-book-image">           <div class="field-content">               <a href="/country"><img typeof="foaf:image" src="xxx.jpg" width="126" height="192" alt="" /></a>           </div>         </div>     </div> </div>     

css

.field-content img {     float: left;     padding-right: 10px;     max-width: 100%;     height: auto; } 

image

enter image description here

hi said here solution may want please out code

.view-content{      display:block;  }  .views-row{      float:left;      margin:5px;      padding:5px;      border:1px solid grey;  }  .views-field.views-field-title {      text-align: center;  }  .field-content img {      width: 150px;      height: 200px;  }
<div class="view-content">    <div class="views-row views-row-1 views-row-odd views-row-first">        <div class="views-field views-field-title">                  <span class="field-content"><a href="/country">up country</a></span>          </div>          <div class="views-field views-field-field-book-image">            <div class="field-content">                <a href="/country">  <img src="http://www.iconpng.com/png/stickers/books.png" alt="smiley face">  </a>              </div>          </div>      </div>  <div class="views-row views-row-1 views-row-odd views-row-first">        <div class="views-field views-field-title">                  <span class="field-content"><a href="/country">up country</a></span>          </div>          <div class="views-field views-field-field-book-image">            <div class="field-content">                <a href="/country">  <img src="http://icons.iconarchive.com/icons/itzikgur/my-seven/512/books-2-icon.png" alt="smiley face">  </a>              </div>          </div>      </div>  <div class="views-row views-row-1 views-row-odd views-row-first">        <div class="views-field views-field-title">                  <span class="field-content"><a href="/country">up country</a></span>          </div>          <div class="views-field views-field-field-book-image">            <div class="field-content">                <a href="/country">  <img src="http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons/simple-black-square-icons-culture/126872-simple-black-square-icon-culture-books3-stacked.png" alt="smiley face">  </a>              </div>          </div>      </div>  </div> 

and here demo working code of code

demo


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -