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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:48:59+00:00 2026-06-03T05:48:59+00:00

PreNote: This is not a duplicate. I’ve checked several questions and mine is different

  • 0

PreNote: This is not a duplicate. I’ve checked several questions and mine is different in details.

I currently have horizontal nav menu like this on a web page:
horizontalMenu

The menu is a ul element. The problem is that currently I had to specify the margin-right explicitly to get the spacing between li’s. I want the spacing to be 60px whenever possible, but to shrink whenever the browser is shrinked and no longer allows such a large menu spacing.

How can I achieve this?

  • 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-03T05:49:01+00:00Added an answer on June 3, 2026 at 5:49 am

    I think you are searching for the uber-holy Uber-Grail. I maybe wrong but I don’t think it’s possible with CSS alone. It’s because there is nothing like max-margin like you have max-width. And if you use JS (jQuery for example) you will have a sort of jumping of the positioning, because JS has to wait until the page is loaded and ready and then start calculating the width values.

    If you are willing to do it a little bit different. I suggest you define a maximum width of the whole navigation which is coupled with the windows size and then use CSS flex for the modern browsers. If you use modernizr.com you can branch in CSS for the IE8 and use display:table, table-row, table-cell instead. For IE7 you just use float.

    Why not use display:table in modern browsers? I maybe look the same but the margin gain between the elements differ in flex and table. While in flex the gaps between the elements are absolutely the same (meaning pixel wise), they are relatively the same in table (meaning wider table cells gain more space than the narrow ones)

    table
    +--------------------------------+---------+
    |      wide content in here      |  short  |
    +--------------------------------+---------+
       6px                       6px  2px    2px
    
    
    flex
    +----------------------------+-------------+
    |    wide content in here    |    short    |
    +----------------------------+-------------+
      4px                     4px 4px       4px
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First I retrieve the Note objects in the service layer: List<Note> notes = this.getNotes();
I'm trying to use content negotiation to give both a HTML and a RDF/XML
I am grabbing a string and using $.parseJSON(string) but keep getting the following error:

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.