Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 840101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:34:17+00:00 2026-05-15T05:34:17+00:00

This shouldn’t be hard…I have a menu and some content wrapped in a centered,

  • 0

This shouldn’t be hard…I have a menu and some content wrapped in a centered, liquid div. The content is positioned absolute. All I want to do is center #content-container. What am I missing here?

    #wrapper {
        max-width:100%;
        min-width:600px;
        min-height:100%;
        margin:0 auto;
    }

    #header {
     -moz-background-clip:border;
     -moz-background-origin:padding;
     -moz-background-size:auto auto;
     background-attachment:scroll;
     background-color:transparent;
     background-image:url(images/KMIAFS_banner.jpg);
     background-position:center top;
     background-repeat:no-repeat;
     height:150px;
    }

    #menu {
     margin-top:150px;
     clear:left;
     float:left;
     padding:0;
     border-top:6px solid #336699;
     width:100%;
     overflow:hidden;
    }

    #menu ul {
     float:left;
     margin:0;
     padding:0;
     list-style:none;
     position:relative;
     left:50%;
     text-align:center;
    }

    #menu ul li {
     display:block;
     float:left;
     list-style:none;
     margin:0;
     padding:0;
     position:relative;
     right:50%;
    }

    #menu ul li a {
     display:block;
     float:left;
     margin:0 1px 0 0;
     padding:30px 10px 6px 10px;
     background:#336699;
     text-decoration:none;
     color:#fff;
    }

    #menu ul li a:hover {
     padding:35px 10px 6px 10px;
    }

    #menu ul li.active a, #menu ul li.active a:hover {
     padding:40px 10px 6px 10px;
    }

    #content-container {
     top:225px;
     position:absolute;
     margin:0 auto;
     width:1000px;
     background-color:#fff;
    }

    #content {
     clear:left;
     float:left;
     width:610px;
     padding:20px 0;
     margin:0 0 0 30px;
     display:inline;
    }

    #content h2 {
     margin:0;
    }

    #aside {
     float:right;
     width:290px;
     padding:20px 0;
     margin:0 20px 0 0;
     display:inline;
    }

    #aside h3 {
     margin:0;
    }


<div id="wrapper">
<div id="header">
 <a id="box-link" href="index.html"></a>
    <div id="menu">
       <ul>
          <li><a href="" title="Link01">Link01</a></li>
          <li><a href="" title="Link02">Link02</a></li>
          <li><a href="" title="Link03">Link03</a></li>
          <li><a href="" title="Link04">Link04</a></li>
          <li><a href="" title="Link05">Link05</a></li>
          <li><a href="" title="Link06">Link06</a></li>
          <li><a href="" title="Link07">Link07</a></li>
          <li><a href="" title="Link08">Link08</a></li>
       </ul>        
    </div>
  <div id="content-container">
  <div id="content">
   <h2>
    Page heading
   </h2>
   <p>
    Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
   </p>
   <p>
    Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
   </p>
   <p>
    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
   </p>
  </div>
  <div id="aside">
   <h3>
    Aside heading
   </h3>
   <p>
    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan.
   </p>
  </div>
 </div>
</div>
</div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:34:18+00:00Added an answer on May 15, 2026 at 5:34 am

    There are a couple of solutions to this problem.

    The easiest is to remove the absolute positioning from the #content-container. That will allow the margin: 0 auto to center the div. In order to fix the issue with the vertical movement when you hover over the menu (which I suspect is why you made it absolute positioned) just set the height of the menu div (100px seems like enough, but you can play with it). So these are your modifications:

     #menu {
          margin-top:150px;
          clear:left;
          float:left;
          padding:0;
          border-top:6px solid #336699;
          width:100%;
          overflow:hidden;
          height: 100px;
      }
    
      #content-container {
          margin:0 auto;
          width:1000px;
          background-color:#fff;
          left: 100px;
      }
    

    The other solution, if you really want to keep the #content-container absolute positioned, is to wrap the #content-container div in another div, say #inner-wrapper, and set that div’s position to relative. That will make #content-container position itself relative to #inner-wrapper, rather than the window. That CSS might look like this:

      #inner-wrapper {
        position: relative;
        margin: 0 auto;
        width: 1000px;
      }
    

    This trick alone won’t keep the menu aligned, however. To do that you’d have to wrap the menu in this new div, and modify your CSS/HTML to have the blue top border still extend the width of the page. Not too difficult, but it’s more work.

    Personally, I’d just do the first solution and call it a day.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.