problem with vertical centering an image

Discussion in 'ASP .Net' started by Jeff, May 14, 2007.

  1. Jeff

    Jeff Guest

    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??
     
    Jeff, May 14, 2007
    #1
    1. Advertising

  2. On May 14, 11:57 pm, "Jeff" <> 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
     
    Alexey Smirnov, May 15, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tomas
    Replies:
    3
    Views:
    801
    Tomas
    Oct 31, 2003
  2. Replies:
    3
    Views:
    5,011
  3. Replies:
    1
    Views:
    505
    Neredbojias
    Mar 28, 2006
  4. Ciaran
    Replies:
    4
    Views:
    645
    Ben C
    May 17, 2007
  5. topal
    Replies:
    0
    Views:
    275
    topal
    Jan 16, 2009
Loading...

Share This Page