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 8782187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:30:35+00:00 2026-06-13T20:30:35+00:00

Goal: I would like the menu items to take up the same amount of

  • 0

Goal: I would like the menu items to take up the same amount of space in regards to each other. When stretching the display space, I would not like menu items to collapse to their own line. Instead, I would like them to get closer and closer together.


attempt 1:

<!DOCTYPE html>
<head>
    <meta charset="utf-8">
</head>

<style>
    #container{
        width: 100%;
    }


    #navigation{
        width: 100%;
        background: #333;
        display: table;
    }
    #navigation ul{
        margin:0px auto;
        padding: 0 0 0 0;
        display: table-row;

    }
    #navigation li{
        list-style-type: none;
        display: inline;
        display: table-cell;
    }
    #navigation li a{
        float: left;
        /*padding: 5px 10.2%;*/
        padding: 5px;
        color: #FFFFFF;
        text-decoration: none;
        text-align: center;
    }
    #navigation li a:hover{ 
        background: #1C5EC2; 
    }
</style>

</head>
<body>
    <div id="container">
        <div id="navigation">
            <ul>
                <li><a href="#" alt="Home"        >Home</a>        </li>
                <li><a href="#" alt="Games"       >Games</a>       </li>
                <li><a href="#" alt="High Scores" >High Scores</a> </li>
                <li><a href="#" alt="Contact Us"  >Contact Us</a>  </li>
            </ul>
        </div>
    </div>
</body>
</html>

Although these items all stay together horizontally, they are not equally spaced apart. Also, highlighting over them does not shade as wide of an area as I would like.


attempt 2:

<!DOCTYPE html>
<head>
    <meta charset="utf-8">
</head>

<style>
    #container{
        width: 100%;
    }


    #navigation{
        float: left;
        width: 100%;
        background: #333;
    }
    #navigation ul{
        margin: 0;
        padding: 0;
    }
    #navigation ul li{
        list-style-type: none;
        display: inline;
    }
    #navigation li a{
        display: inline;
        float: left;
        padding: 5px 10.3%;
        color: #FFFFFF;
        text-decoration: none;
    }
    #navigation li a:hover { background: #1C5EC2; }
</style>

</head>
<body>
    <div id="container">
        <div id="navigation">
            <ul>
                <li><a href="#" alt="Home"        >Home</a>        </li>
                <li><a href="#" alt="Games"       >Games</a>       </li>
                <li><a href="#" alt="High Scores" >High Scores</a> </li>
                <li><a href="#" alt="Contact Us"  >Contact Us</a>  </li>
            </ul>
        </div>
    </div>
</body>
</html>

This example is almost exactly what I want. Everything about this is correct, except that stretching the display size smaller puts menu items on a line below the other items.


How can I can I take the non-wrapping behavior of the first attempt, and apply it to my second attempt? My goal is to have a working implementation of the 2nd attempt that does not wrap menu items.

*note: i have separate CSS files and html involved, but I included only what I think is needed for the problem. thank you.

  • 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-13T20:30:39+00:00Added an answer on June 13, 2026 at 8:30 pm

    Here – I’ve made a fiddle. Is this what you are looking for?
    link

    I’ve changed the CSS for your li and a elements:

    #navigation ul li {
    
        list-style-type: none;
        float: left;
        width: 25%;    
        text-align: center;
    }
    
    
    #navigation li a {
    
        color: #FFFFFF;
        text-decoration: none;
        padding: 5px 0px;
        display: block;    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have a Maven goal trigger the execution of a java
I would like to rewrite the collection that is returned by Mage::getResourceModel('sales/order_collection'); My goal
Goal I am building an Eclipse plugin targeting the 3.7 environment and would like
The goal would be to set the profile the same way as in a
I would like to have a confirmation on some point. My goal is to
I am using bootstrap-dropdown to generate a Dropdown menu. I would like to disable
Original goal: I have a TreeMenu that i use to display my Menu. In
I building a blog for school i would like to display the count of
My goal I would like to let browsers cache my whole website, but only
I would like to create a test application with PyGTK. My goal is to

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.