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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:34:02+00:00 2026-05-26T05:34:02+00:00

My horizontal navigation bar looks like this: | MENU-ITEM 1 | MENU-ITEM-2 | MENU-ITEM

  • 0

My horizontal navigation bar looks like this:


| MENU-ITEM 1 | MENU-ITEM-2 | MENU-ITEM 3 | SEARCH FIELD              |

The menu-items have equal width, but since the website is cms-driven, the count of items and therefore the width of the menu-item-list will change.

I’m looking for a CSS solution for automatically stretching the search-field on the right to use 100% of the remaining space inside the navigation bar. The navigation-bar’s total width is static (about 950px).

html is something like this, but maybe I need wrappers anyway:

<div id="nav">
   <ul id="nav-items">
      <li class="nav-item">MENU-ITEM 1</li>
      <li class="nav-item">MENU-ITEM 1</li>
      <li class="nav-item">MENU-ITEM 1</li>
   </ul>
   <div id="search-cont">
      <input id="search">
   </div>
</div>
  • 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-05-26T05:34:02+00:00Added an answer on May 26, 2026 at 5:34 am

    Here is a fiddle with the basics: http://jsfiddle.net/Qg2ag/

    The idea is:

    1. The wrapper of an input field must have display:block and overflow:hidden.
    2. The menu near it must have the float:left and the items in it must be inline or inline-block.

    So, the floated block eats it’s width from the block with an overflow, so you can set width: 100% in it safely. And I’ve added padding-right: 6px to the input’s wrapper so there is no need in ajusting it’s width or using other box model. Of course the size of this padding can vary if you’d change the input’s style.

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

Sidebar

Related Questions

I am doing an horizontal dropdown menu. It looks like this : [menu1][menu2][menu3][menu4] But
I have a navigation bar like this <div id=top data-role=navbar data-type=horizontal> <ul> <li><a href=#a>A</a></li>
I have made a navigation horizontal bar, but I seem to have a following
I have created a navigation bar with a horizontal unordered list. This displays fine
I'm creating a horizontal ul navigation bar. Each li item is a different width.
So I have the following CSS in place to display a horizontal navigation bar
I have a horizontal menu navigation. The code is: <div class=menu-holder> <ul class=menu> <li>
A horizontal compass looks something like this if you are facing due East (90
Basically, I am building a horizontal navigation bar. I have following markup: <ui:style src=../common.css
I have a horizontal navigation bar. Each button is a span with a background

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.