I created a row of buttons that enlarge on hover on a Sharepoint 2013 webpage , here is the code:
<style type="text/css">
.thumbnail {
position:relative;
width:100px;
height:100px;
display:block;
}
.thumbnail:hover {
top:-25px;
width:130px;
height:130px;
z-index: 999;
}
a img{
float: right;
}
</style>
<a href="site.aspx">
<img src="image.png" class="thumbnail" alt="" style="margin: 5px;"/> </a>
<a href="site1.aspx">
<img src="image1.png" class="thumbnail" alt="" style="margin: 5px;"/> </a>
<a href="site2.aspx">
<img src="image2.png" class="thumbnail" alt="" style="margin: 5px;"/></a>
<a href="sites3.aspx">
<img src="image3.png" class="thumbnail" alt="" style="margin: 5px;"/> </a>
<a href="site4.aspx">
<img src="image4.png" class="thumbnail" alt="" style="margin: 5px;"/></a>
Now, with the following command I made those buttons aligned horizontally instead of vertically.
a img{
float: right;
}
Problem is, this way they are aligned right (or left, if I switch the command to "left"), but I need to have them centered. At first I solved the problem by using CSS and setting the margins (margin-left and margin-right), but this solution causes troubles when I resize the browser windows or when I change the screen resolution. Any ideas on how have them at the center of the screen?
<div id="imgContainer">YOUR IMAGES</div>
and then add css:#imgContainer { width: 100%; text-align: center; }
margin: 0 auto;
to your images. jsFiddle