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 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Centering Layers?

    Does anyone know what the setting is to center a layer?

    For example:
    <div id="Layer7" style="position:absolute; width:780px; height:16px; z-index:1; left: 0px; top: 632px; background-color: #FF9900; layer-background-color: #FF9900; border: 1px none #000000;">
    Where/what would i put in the Position or anything to make this layer center on the page?


  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Glasgow, Scotland
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    imroue

    I'm assuming you want this layer to appear in the centre of the browser window

    If so you could try this

    body {
    margin: 20px 0px; padding: 0px; text-align: center;
    }

    And then put in your 'div' layer

    Don't know how cross-browser compatible this is though…

    meerkat
    Ya don't need a weatherman to know
    which way the wind blows...

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This thread is about centering a table with CSS, but there's not much difference with centering a div:
    http://www.codingforums.com/showthre...threadid=10211


  •  

    Posting Permissions

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