? CSS replacing <img align="absmiddle">

Discussion in 'HTML' started by mark | r, Jan 6, 2004.

  1. mark | r

    mark | r Guest

    anyone know how this can be achieved in css?

    i have an image e.g.

    <img src="image.gif" width="20" height="40" align="absmiddle" alt="" />some
    text

    how can i align the text with the absolute middle of the image using only
    css?

    mark
    mark | r, Jan 6, 2004
    #1
    1. Advertising

  2. mark | r

    Steve Pugh Guest

    "mark | r" <> wrote:

    ><img src="image.gif" width="20" height="40" align="absmiddle" alt="" />some
    >text


    absmiddle is not a permitetd value of align in any standard version of
    HTML. The permitted values are top, middle, bottom, left and right.

    >how can i align the text with the absolute middle of the image using only
    >css?


    <p><img src="image.gif" width="20" height="40" style="vertical-align:
    middle;" alt="" />some text</p>

    From my experiments it looks like vertical-align: middle behaves more
    like the non-standard align="absmiddle" than the standard
    align="middle", so it seems to be exactly what you want. (Tested in
    IE6, Opera 7.23 and Mozilla 1.5, note that in the last two
    align="middle" and align="absmiddle" display the same anyway - only IE
    clings to the old Netscape 2(?) display).

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Jan 6, 2004
    #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. Kay
    Replies:
    2
    Views:
    7,137
  2. Paul F. Johnson
    Replies:
    19
    Views:
    921
    Spartanicus
    Oct 15, 2004
  3. tshad

    text-align vs align

    tshad, Jun 23, 2005, in forum: HTML
    Replies:
    1
    Views:
    1,244
    David Dorward
    Jun 23, 2005
  4. Paul Lautman

    left align within centre align

    Paul Lautman, Mar 3, 2006, in forum: HTML
    Replies:
    3
    Views:
    564
    Paul Lautman
    Mar 3, 2006
  5. Ubi
    Replies:
    13
    Views:
    8,051
Loading...

Share This Page