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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:52:52+00:00 2026-05-28T19:52:52+00:00

I have a problem as i’ve described in title. I’ve got menu and I

  • 0

I have a problem as i’ve described in title.
I’ve got menu and I use inside it float:left for divs. Menu box contains search box and when i resize page i don’t want search box to jump to next line when width of site is too little, i want to be “cut/hidden” this part of search box.

I’ve tried with inline-block, position:absolute, overflow:hidden and nothing works as i want to.

Sample (i want this green boxes to stay in first line and i don’t want to have horizontal scroll bar because of hidden elements, also i want “content” to be able to resize even we pass size limit which guarantees to show every menu item ):

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

        <style>
          html, body {width:100%}
          #header { width: 100%; height: 50px; }
          #menu_box { width: 100%; height: 50px; background: red; }
          .menu_item { background: green; width: 100px; height: 25px; float: left; }
          #content{ width: 100%; height: 100%; text-align: center; }
        </style>
        </head>
        <body>
        <div id="header">
          <div id="menu_box"> 
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
            <div class="menu_item">sd</div>
          </div>
        </div>

        <div id="content">
        text which align is center
        </div>
        </body>
        </html>

EDIT2, now you should understand what I mean, in this case it doesn’t work properly, overflow:hidden do nothing (it was first thing which i’ve tried). Look at content. To avoid questions: yes, i need to use css tables.

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

        <style>
          html, body {width:100%}
          #header { display: table-cell; width: 100%; height: 50px; }
          #menu_box { width: 800px; height: 50px; background: red; overflow: hidden; }
          .menu_item { background: green; width: 100px; height: 25px; float: left;}
          #content{ display:table-cell; width: 100%; height: 100%; text-align: center; }

          .row { display: table-row; width: 100%; }
          #table {
            width: 100%;
            height: 100%;
            border-collapse: collapse;
        }
        </style>
        </head>
        <body>
        <div id="table">
            <div class="row">
                <div id="header">
                  <div id="menu_box"> 
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                    <div class="menu_item">sd</div>
                  </div>
                </div>
            </div>

            <div class="row">
                <div id="content">
                LOOK AT THIS (when width of menu_box is constant and when isn't)<br>Try to resize this site
                </div>
            </div>
        </div>
        </body>
        </html>
  • 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-28T19:52:53+00:00Added an answer on May 28, 2026 at 7:52 pm

    Resize width on resize of window.
    Here’s the jQuery way,

    $(window).resize(function(){
       // Change your search box width here relative to window's width
    })
    

    Here the css way,

    <div style='width:800px'>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
                <div class="menu_item">sd</div>
              </div>
    

    i.e. wrap it it a div and fix its width.

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

Sidebar

Related Questions

I have problem witch change style border-left-color in next button, if main button is
I have problem in C#. I have a list box and a class called
I have problem positioning left sidebar (variating height DIV) ON IE6. Main needs: 1.
I have problem with types in my schema when trying to use xsd:any element
have problem with ampersand (&) How to search for the words (or sentences) that
I have problem to put several countdowns on page. I use HTML.Partial: <span><strong id=time_h></strong>godz.
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE

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.