By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

problem with vertical centering an image

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.