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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:55:25+00:00 2026-06-10T00:55:25+00:00

I am trying to create a navigation panel for my website. I would like

  • 0

I am trying to create a navigation panel for my website. I would like it to consist of:

  • Four tabs in equal size with text-centered in each tab.
  • They should fill the whole page width.

I would really like the design to be flexible and browser friendly. I have tried various float techniques, but I can’t get it to work. I hope that you can help me out!

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-10T00:55:26+00:00Added an answer on June 10, 2026 at 12:55 am

    HTML

    EDIT: it’s 2015 and HTML5 has been there for a while; following code should be inside a nav element (html5doctor) with landmark ARIA attribute role="navigation" on it (and 99.9% of the time be unique in any given page).

    A navigation panel should use an unordered list of links:

    <ul id="nav">
      <li><a href="#">One</a></li>
      <li><a href="#"> Second</a></li>
      <li><a href="#">Third</a></li>
      <li><a href="#">Fourth and last, so large that... worst case</a></li>
    </ul>
    

    CSS

    EDIT2: It’s 2017, just use Flexbox (with or without flex-wrap: wrap)

    inline-block is useful but has one drawback: whitespace between two elements must be carefully managed. Whether removed or no </li> in HTML5 or </li> at the beginning of the following line stuck like </li><li>next item or other tricks, you still have to do something or it’ll create a ~4px gap between 2 elements.

    25% + 25% + 25% + 25% doesn’t equal 100% on all browsers if the total isn’t a multiple of 4. Each browser has its own rounding method.

    If you want elements to total 100% width and equal width, another method is to use display: table (and table-cell) with table-layout: fixed to force browsers to use the other table algorithm, the one that doesn’t try to adapt cells width to content but respect the widths wanted by the designer/developer as far as possible.

    ul {
      margin: 0;
      padding: 0;
    }
    li {
      list-style-type: none;
    }
    #nav {
      display: table;
      table-layout: fixed;
      text-align: center;
    }
    #nav li {
      display: table-cell;
      width: 25%;
      padding-right: 1px;
      height: auto;
      vertical-align: bottom;
    }
    #nav a {
      display: block;
      min-height: 100%;
      padding: 4px 10px;
      background-color: #222;
      color: white;
      border-radius: 6px 6px 0 0;
    }
    

    Fiddle

    http://jsfiddle.net/PhilippeVay/aHCy3/1/
    edit: http://jsfiddle.net/PhilippeVay/aHCy3/2/ with another method for space between each tab, courtesy of my colleague.

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

Sidebar

Related Questions

I am trying to create some HTML/CSS for footer navigation. What I would like
I'm trying to create a navigation bar in html+css that looks like the image
I am trying to create a menu navigation sort of like tab's but with
I am trying to create some ajax with my website, click on navigation and
I'm trying to create a navigation panel based on the Flex Accordion control. The
I'm trying to create a basic navigation and I'd like to have a horizontal
I am trying to create a little admin-only navigation panel for my site that
I'm trying to create a navigation menu which would change parent div background when
I'm having a pretty big problem trying to create navigation on my page. If
I'am trying to create a navigation menu with a sub menu, and fiddled with

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.