5
Reply

center an image inside a repeater

abed akhi

abed akhi

Oct 15 2012 5:14 AM
3.6k
Hi,

I have the below code:
<ul id="slide" style=" width:340px; height:480px; margin-left:2em; background-image: url('Images/boxframe.jpg'); vertical-align:middle;" >
<asp:Repeater runat="server" ID="repeater1">
<ItemTemplate>
<asp:Image ID="Image" runat="server" ImageUrl='<%# Container.DataItem %>' />
</ItemTemplate>
</asp:Repeater>
</ul>

and I need to place the image at the center of the ul as the ul is a boxframe so a frame and I need to place the image at the center of that frame I used:
<center><asp:Image..></center>
and <asp:Image style="margin:0px auto; display:block"...>
but that did not work what should I do?

Answers (5)