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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:06:12+00:00 2026-06-13T03:06:12+00:00

I have a nav bar that displays fine when I have 5 navigation objects

  • 0

I have a nav bar that displays fine when I have 5 navigation objects in it but when I add 3 more it drops below the main header why?

5 Objects:

enter image description here

7 Objects:

enter image description here

HTML:

<div id="header">
    <div class="w960">
        <div id="logo">
            <h2>Text</h2>
            <p>Text</p>
        </div>
        <nav>
            <ul>
                <li class="first active">
                    <a href="#">1</a>
                </li>
                <li>
                    <a href="#">2</a>
                </li>
                <li>
                    <a href="#">3</a>
                </li>
                <li>
                    <a href="#">4 </a>
                </li>
                <li class="last">
                    <a href="#">5</a>
                </li>
            </ul>
        </nav>
    </div>
</div><!-- end of header -->

​

CSS:

#header{background:#2d2d2f;width:100%; height:120px;clear:both;font-family:Signika,Arial,sans-serif;}

.w960 { width:960px; margin:auto; }

nav{width:auto; float:right;line-height: 50px;}
nav ul li{font-size:14px; float:left;display: inline-block;padding: 0px 11px;text-transform:uppercase;}
nav ul li a{padding: 0px 10px; color:#ffb400; text-decoration:none;}
nav ul li a:hover, .active a{color:#fff}

#logo{width: 40%;float: left;height: 90px;}
#logo h2{line-height: 41px;color:#FFB400;font-size:28px;}
#logo h2 span{color:#FFB400;}
#logo p {margin-top: -25px;color:#b8bbbc;}
  • 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-13T03:06:13+00:00Added an answer on June 13, 2026 at 3:06 am

    You have two floating elements in the same line, if the sum of both width and they are bigger than the available space, they will break the line and place the second floating element below the previous: in your case nav below logo. Add borders to each of them and you will see that they are just too big.

    One alternative is this: http://jsfiddle.net/Bs93k/

    nav{width:auto; /*float:right;*/ overflow:auto; line-height: 50px;}
    

    This will make nav to take the available space, however, I don’t think its contents would behave as you like.

    A second alternative is this: http://jsfiddle.net/PU7hV/

    #header{display:table;}
    .w960 {position:relative;}
    nav{/*float:right;*/ position:absolute; top:0; right:0;}
    

    Note that i wrote what you have to add and commented what to delete, the rest, leave them as you already had.

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

Sidebar

Related Questions

I have a didSelectRowAtIndexPath action that adds a navigation bar and displays a new
I have a web page that, at a certain point, displays a navigation bar
I have a nav bar with children unordered lists nested under the main navbar
I have a nav bar that when I over over an element the next
I have a tab bar application that contains navigation views in 2 of its
I have a nav bar with a drop down that is working beautifully. The
I have a navigation bar at the top of my eform that skips to
I'm trying to get a navigation bar that consists of a nav with an
I have a navigation bar/list that is using only HTML and CSS. The background
I have a navigation bar that is a list with multiple li naturally. On

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.