SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    div center align with absolute postision

    I want my div menu bar to be centerally aligned on the page.. and to be on top of the text when the dropmenu menu appears.
    So far, the css code is:

    position:absolute;
    background-color:#6699CC;
    height:25px;
    margin:0px auto;
    width:800px

    The things is , when i use absolute position , the margin isnt working.
    And when i use relative position, margin value centers the menu, but it doesnt come over the text below it..

    how can do both things?

  2. #2
    SitePoint Addict
    Join Date
    Apr 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post a link to it - it'll make it easier for us to debug...

  3. #3
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry, the page cant be uploaded now.. its a school site, and it has to be right to upload..
    but i found something and its wroking for me..
    i just added these lines in the CSS

    either

    left:20%;
    right:20%;
    max-width:750px;
    min-width:750px


    or

    left:50%;
    margin-right:0px auto;
    max-width:750px;
    margin-left:-365px


    both work the same way..


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
  •