Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Location
    NY, USA
    Posts
    132
    Thanks
    1
    Thanked 1 Time in 1 Post

    CSS Aligning to middle

    Hi,

    If you go to http://www.gamescool.com/dfox/index.php you will notice that in the top box, the little house image and logo text are not aligned to the middle of the box. I am trying to align them to the middle. I have tried things like vertical-align: middle; but it has not works. In Firefox, both are almost aligned to the middle. In internet explorer, they are not even close. How can I line the image and the text image to the middle of the box?

    Thanks for your help,
    ~David

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Code:
    div.title_bar
    {
    text-align:center;
    }

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Which direction?

    Just to make things clear: do you mean vertical or horizontal alignment?

    For horizontal (left-to-right) alignment, hemebond's suggestion should do the trick since all the content you have in there is inline; for vertical (top-to-bottom) alignment, experiment with margins / padding on the parent element (the "title_bar" div) to force the images up more. It would probably look better to have them both sit on a common base line rather then actually being vertically centered anyway.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    Regular Coder
    Join Date
    Jan 2005
    Location
    NY, USA
    Posts
    132
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hi,

    Stupid mistake on my part. I mean verticaly in the box. I will use padding or a margin to align one part of them, which is easier, and may look nicer like ronald said.

    Thanks for your help,
    ~David


  •  

    Posting Permissions

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