Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problem with vertical centering an image

Reply
Thread Tools

problem with vertical centering an image

 
 
Jeff
Guest
Posts: n/a
 
      05-14-2007
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??


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-15-2007
On May 14, 11:57 pm, "Jeff" <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable vertical image centering? topal Javascript 0 01-16-2009 11:15 PM
Why is vertical centering such a pain in the ass? Ciaran HTML 4 05-17-2007 04:51 PM
vertical centering in css google@rbtbowers.com HTML 1 03-28-2006 01:00 AM
vertical centering of text google@rbtbowers.com HTML 3 03-19-2006 08:36 PM
Horizontal and vertical centering of a table Tomas HTML 3 10-31-2003 10:14 AM



Advertisments