469,608 Members | 2,632 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,608 developers. It's quick & easy.

problem with vertical centering an image

ASP.NET 2.0

The code below doesn't vertically center the image within the div, what am I
missing??

<div style="background-color:Green; width:210px; height:230px;
text-align:center; vertical-align:middle;">
<asp:Image ID="imgProfile" runat="server" Height="220px"
Width="200px" />
</div>

I've also tryed this:
<div style="background-color:Green; width:210px; height:230px;
padding:5px;">
<asp:Image ID="imgProfile" runat="server" Height="220px"
Width="200px" />
</div>
Which doesn't work either.

I did this on IE7

Any suggestions??
May 14 '07 #1
1 1567
On May 14, 11:57 pm, "Jeff" <it_consulta...@hotmail.com.NOSPAMwrote:
ASP.NET 2.0

The code below doesn't vertically center the image within the div, what am I
missing??

<div style="background-color:Green; width:210px; height:230px;
text-align:center; vertical-align:middle;">
<asp:Image ID="imgProfile" runat="server" Height="220px"
Width="200px" />
</div>

I've also tryed this:
<div style="background-color:Green; width:210px; height:230px;
padding:5px;">
<asp:Image ID="imgProfile" runat="server" Height="220px"
Width="200px" />
</div>
Which doesn't work either.

I did this on IE7

Any suggestions??
line-height:230px

May 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Garmt de Vries | last post: by
1 post views Thread by Kenneth | last post: by
3 posts views Thread by Wayfarer | last post: by
2 posts views Thread by Eric Lindsay | last post: by
5 posts views Thread by Markus Ernst | last post: by
14 posts views Thread by Jim Moe | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.