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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Vertical Alignment of a div on a page

    Hi All

    I'm sorry if this has already been asked somewhere else on this forum, I searched but could not find anything.

    Im am trying to get a div to verticly align on a page (dynamicly) so it centres verticly on a page, i have tried many ways in CSS to no avail does anyone have any suggestions?

    Thanks

    Tom

  • #2
    New Coder
    Join Date
    Apr 2006
    Location
    Joussard, Alberta
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure what you mean... but maybe like this:

    Code:
    <html>
    <head>
    <style type="text/css">
    .centered{ margin:25% 0% 25% 0%;
         border: 2px solid blue;
         min-height:25%;
    
    }
    </style>
    <body>
    <div class="centered">
    <p> All your base go here. <br/><br/><br/><br/></p>
    </div>
    </body>
    </html>
    more code would help...
    Last edited by nathan_lamothe; 05-14-2006 at 12:18 AM.

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You a legend, that works!

    Thanks

  • #4
    New Coder
    Join Date
    Apr 2006
    Location
    Joussard, Alberta
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <hoping it still works when used in a page full of stuff...>

    Glad to help.

    playing with my copy, that min-height line isn't actually doing anything... but if you switch it to px instead of % it does... I thought min-height was supposed to work with both?

  • #5
    New to the CF scene
    Join Date
    May 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It didnt when I tryed to plug it in to my current site design, I've scrapped the idea now

    Thanks for your help anyways


  •  

    Posting Permissions

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