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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:12:44+00:00 2026-05-21T02:12:44+00:00

I want to have a SEARCH div where I have a: 1) Button 2)

  • 0

I want to have a SEARCH div where I have a:
1) Button
2) Label
3) TextBox

MY GOAL:
The edit Box should automatically resize to it’s MAX WIDTH by default and whenever I physically resize the browser page, without moving down !!!

I’m not even sure this is something you will want to use a DIV but here is what i have tried (and failed):

<div id="search">    
   <div id="searchbtn">
      <input id="btnSeach" type="button" value="Search" /> 
      Search:  
   </div>
   <div id="searchtxt">
       <input id="txtSearch" name="txtSearch" type="text" value="" /> 
    </div>
</div>

The CSS looks like this:

div#search
{
   height: 30px;
   border: 1px solid #80808D;
   padding: 5px 0px 5px 0px;
}

div#searchbtn
{
   float: left;
   display: inline;
   padding: 0px 10px 0px 10px;
}

div#searchtxt
{
   float: left;
   width: auto;
   display: inline;
   padding-right: 10px;
}

I was hoping that the width: auto meant the div would auto-expand (rsss).

I tried putting a width of 90% on the TextBox but it never works well when resizing.
I tried putting some width on the div searchtxt but again didn’t work properly when resizing.

If using div is the way forward, what would be the right CSS for the various DIVs?
If this is NOT the way …then what other way would work better?

Thanks.

  • 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-21T02:12:44+00:00Added an answer on May 21, 2026 at 2:12 am

    Using some display: trickery…

    Live Demo (Only tested in FireFox 3.6.x)

    <style type="text/css">
    div#search {
       border: 1px solid #80808D;
       display: table;
       height: 30px;
       padding: 5px 0px 5px 0px;
    }
    
    div#searchbtn {
       padding: 0px 10px 0px 10px;
       white-space: nowrap;
    }
    
    div#searchtxt {
       display: table-cell;
       padding-right: 10px;
       width: 100%;
    }
    input#txtSearch {
       width: 100%;
    }
    </style>
    
    <div id="search">
       <div id="searchbtn">
          <input id="btnSeach" type="button" value="Search" />
          Search:
       </div>
       <div id="searchtxt">
           <input id="txtSearch" name="txtSearch" type="text" value="" />
        </div>
    </div>
    

    Note: Internet Explorer 8 (and higher) supports the property values “inline-table”, “run-in”, “table”, “table-caption”, “table-cell”, “table-column”, “table-column-group”, “table-row”, “table-row-group”, and “inherit” only if a !DOCTYPE is specified.

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

Sidebar

Related Questions

I have a search box and search button. I want to call a javascript
I want to have my submit button to the right of my search form.
I have a search field and I want my search button image to be
I have a textbox onin a masterpage which I'm using as a search box.
I have a search page and want to add some filters to it, my
So I have a location search field that I want to accept pretty much
I have input.txt and I want to search for a string and extract a
I want to search the computer from this table and when i have stored
I have a timestamp and I want to search for a single date but
I have a string s and I want to search for the substring of

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.