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

  • Home
  • SEARCH
  • 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 8654109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:42:16+00:00 2026-06-12T14:42:16+00:00

Possible Duplicate: Can we center those divs IE7 and up with variable width horizontally

  • 0

Possible Duplicate:
Can we center those divs “IE7 and up” with variable width horizontally without using inline-block?

I am trying to create a menu which has a background image spanning the full width of the screen with the menu contents constrained to 980px in the middle with the menu contents then aligned within the center of that.

Like this: http://d.pr/i/eYcV

But I don’t want to constrain the area anymore than 980px as the menu items may increase in the future.

I have the following structure in HTML:

<div class="menu">
  <nav class="primary_menu">
      <ul id="menu-primary">
           <li><a href="http://localhost:8888/maldonfire/">Home</a></li>
           <li><a href="http://localhost:8888/maldonfire/blog/">Blog</a></li>
      </ul>
  </nav>        
</div>

With the following CSS:

/* Menu */
.menu{
background: url("images/menu_bg_home.jpg") repeat-x;
height: 70px;
}
.primary_menu{
display: block;
margin: 0px auto;
width: 980px;
height: 70px;
}
.primary_menu ul{
text-align: center;
list-style-type: none;
}
.primary_menu ul li{
float: left;
}

Thanks

  • 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-06-12T14:42:17+00:00Added an answer on June 12, 2026 at 2:42 pm

    There’re a lot of ways to achieve what you’re asking for … simplest is by using inline-blocks like this

    .primary_menu ul{
        text-align: center;
    }
    .primary_menu ul li{
        /*float: left;*/
        display:inline-block;
        margin: 0 20px;
        *display : inline; /* for IE7 and below */
        zoom:1;
    }
    

    Check my answer here : Can we center those divs "IE7 and up" with variable width horizontally without using inline-block?

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

Sidebar

Related Questions

Possible Duplicate: Can I comment a JSON file? We are using a .json file
Possible Duplicate: How to horizontally center a div? One simple way to make an
Possible Duplicate: How can I develop for iPhone using a Windows development machine? I've
Possible Duplicate: Can we post image on twitter using twitter API in Android? I
Possible Duplicate: How do I center text horizontally and vertical in a TextView in
Possible Duplicate: Can you do Desktop Development using JavaScript? I am very familiar with
Possible Duplicate: Can I develop blackberry applications using C#.NET on windows7 can anybody give
Possible Duplicate: Can a local variable's memory be accessed outside its scope? input: #include
Possible Duplicate: Can a local variable's memory be accessed outside its scope? I recently
Possible Duplicate: Can I have multiple background images using CSS? I am making a

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.