Reputation:
I have an issue with aligning thumbnails in a Twitter Bootstrap well:
This is the result for what I have so far:
https://i.sstatic.net/1qUA6.png
As you may notice; the images are aligned to much to the left. The thumbnails are wrapped as such:
<div class="row-fluid">
<div class="span6">
My html:
<ul id="nwthumbs">
<li><a href="#" ><img src="Fernando-Alonso-Ferrari-3_2799133.jpg"><h2><span>Fernando Alonso has credited Ferrari's decision to stop for a new set of we...</span></h2></a>
<button class="btn btn-mini" type="button" >Read More</button></li>
<li><a href="#" ><img src="Sir-Alex-Ferguson_2794602.jpg">
<h2><span data-bind="html: titleShortened">Sir Alex Ferguson says there is 'no chance' of Manchester United repeating ...</span></h2></a><button class="btn btn-mini" type="button" >Read More</button></li><li><a href="#" ><img src="Paul-Bohan-2012_2799199.jpg">
<h2><span>Local Hero claimed a first victory of the year with a determined effort in ...</span>
</h2> </a><button class="btn btn-mini" type="button" >
Read More</button>
</li>
<li><a href="#" ><img src="Douglas_2675905.jpg">
<h2><span>FC Twente chairman Joop Munsterman admits he is unsure whether Newcastle Un...</span></h2> </a><button class="btn btn-mini" type="button" >
Read More</button>
</li>
<li><a href="#" >
<img src="Darryl-Westlake-Walsall_2465450.jpg">
<h2>
<span>Sheffield United have confirmed the signing of promising defender Darryl We...</span>
</h2>
</a>
<button class="btn btn-mini" type="button" >
Read More</button>
</li>
</ul>
I'm using Twitter Bootstrap.
What I have tried so far is making the pictures variable size; width 100% and height 100%, that works, but when resizing to a smaller ViewPort, it will resize the images instead of wrapping the images so that they appear in two columns.
Upvotes: 3
Views: 5195
Reputation: 4976
Try with this CSS :
#nwthumbs {
text-align:center;
}
#nwthumbs > li {
display: inline-block;
*display:inline; /* ie7 fix */
float: none; /* this is the part that makes it work */
}
Upvotes: 2