Reputation: 65
I am trying to build a usercontrol consisting of 5 imagebuttons that have to stack ontop of each other inside a div. The images are of varying size. How do i get them to center themselves inside the containing div?
<div class="ButtonBox">
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="/css/images/lightbulb.png" CssClass="button" />
<br/>
<asp:ImageButton ID="ImageButton2" runat="server"
ImageUrl="/css/images/testimonials.png" CssClass="button" />
<br/>
<asp:ImageButton ID="ImageButton3" runat="server"
ImageUrl="/css/images/templates.png" CssClass="button" />
<br/>
<asp:ImageButton ID="ImageButton4" runat="server"
ImageUrl="/css/images/video.png" CssClass="button" />
<br/>
<asp:ImageButton ID="ImageButton5" runat="server"
ImageUrl="/css/images/audio.png" CssClass="button" />
<br/>
</div>
Upvotes: 0
Views: 965
Reputation: 54001
You can centre your image buttons with a bit of CSS.
.ButtonBox input{
display:block;
margin:0 auto;
}
Upvotes: 1