Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #184641

    Hi! I have read over the internet that to center a div I need to set the left and right margin to Auto. I have tried to place it a several places but I am still unable to center the menu. I can achieve it by adding right:320px there:
    #top .main_menu .menu{
    height:50px;
    line-height:30px;
    padding-left:13px;
    right:320px;
    position:absolute;
    z-index:300;
    top:40px;
    width:750px;
    }

    But its not okay on all screen size. I would like to know if there is a way to center it using margin auto?
    Thanks for your help again!!!
    Rick

    #184647

    Hi,

    That element is absolute positioned, in order to center it you’d have to set its left/right elements to 0:

    #top .main_menu .menu{
    height:50px;
    line-height:30px;
    padding-left:13px;
    right: 0;
    left: 0;
    margin: 0 auto;
    position:absolute;
    z-index:300;
    top:40px;
    width:750px;
    }

    If that doesn’t work, please post the link to your website.

    Regards,
    Josue

    #184655

    Hem.. You are awesome!! First, its like if you are wainting for my request, you are terribly quick!!!!! Thanks for your help, that solved my problem!!
    Thanks
    Rick

    #184657

    You are welcome Rick, glad i could help :)

    Regards,
    
Josue

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.