Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times

    vertical-align being an ***

    and not working. im trying to align aan image so it appears in the center of the page no matter what browser its on but for some reason none of the vertical-align properties from here..... CSS vertical-align property
    are working

    the code is not worth posting its literally just an img src reference in the html and the css is margin auto and then the various properties, middle % etc.

    is this out of date or has anyone else had any problems with it?

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,139
    Member #
    27197
    Liked
    959 times
    That's because it's never worked like that. Not sure why, but it never has. Search the Googles for a vertical centering technique, there are several out there.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times
    thanks dude, there seems to be alot of messy methods, this seems the simplest though, in css

    margin: auto;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;

    although that aligns it in center on both planes, i also noticed when i changed the left or right by even 10px it would jump to the edge of the relative sides. why is that?

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,139
    Member #
    27197
    Liked
    959 times
    Because you're breaking the auto margin.

    That's probably my favorite method, mostly because of the relativity it allows. Most other methods require static sizes and math.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  6. #5
    Junior Member
    Join Date
    Feb 2014
    Posts
    14
    Member #
    38383
    Could also try adding display:inline to the IMG element you want to align. Try that.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com