SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Git-R-Done
    Join Date
    Nov 2001
    Posts
    1,194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Vertically aligning text next to an image on the same line

    I have an image next to some text on the saem line. I'm using vertical-align:middle; in the style from the image. It's off by about 2 pixels from the bottom because it's going by the height of the text and including the bottom of the y so it doesn't look vertically centered.

    Does someone know how to adjust the vertical positon of the image instead of letting it "automatically" vertically align itself?
    John Saunders

  2. #2
    SitePoint Member starleos's Avatar
    Join Date
    Mar 2004
    Location
    Spain
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi John,

    try with position:relative or put the image and the text in a span, do you have a link to the page?

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,327
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    vertical-align: baseline | bottom | text-bottom
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •