WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need help centering a div (3 posts)

  1. quannage
    Member
    Posted 1 year ago #

    Hello!

    I'm working on a site for a client, and I'm having a really hard time centering my site. I've tried the usual "margin: 0 auto" thing for the div all of my content appears in, but for some strange reason that div shows up to the left of center, and there is more blank space on the right of the div than on the left of it.

    I've tried a number of things in CSS to get the site to center, but nothing is working.

    the site is http://quanwilliams.com/freelance, and here is the pertinent CSS:

    html, body{
    font-family: 'Milonga', cursive;
    background-image:url('country-wallpaper1.jpg');
    background-attachment: fixed;
    
    }
    
    div {
    margin: 0 auto;
    }
    
    .wrapper {
    height: auto;
    max-width: 980px;
    width: 70%;
    
    }
    
    #mainarea {
    position: absolute;
    width: 65%;
    background: #FFED94;
    padding: 0px 0px;
    margin-left:auto;
    margin-right:auto;
    }

    all of the content for the site is contained within the mainarea div.

    So what can I do to get this site to properly center?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    I'm sorry but it is really beyond the scope of these forums to deal with general CSS issues. Try a dedicated CSS resource such as http://www.css-discuss.org/ instead. In the meantime, try using Firefox with the Firebug add-on for this kind of CSS work. Or use whatever developer tool is available in your web browser.
    http://getfirebug.com/

  3. quannage
    Member
    Posted 1 year ago #

    Can do. thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic