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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:30:06+00:00 2026-05-26T18:30:06+00:00

Is there a way (CSS) for me to make sure that a textbox and

  • 0

Is there a way (CSS) for me to make sure that a textbox and search button vary sizes when the div does?

This is what my search bar looks like:

<div class="userinfo">
    <form><table id="search" border="0"><tr>
            <td valign="top"><input type="text" name="search"></td>
            <td valign="top"><input type="image" name="search-button" src="img/search.png"></td>
    </tr></table></form>
</div>

And userinfo:

.userinfo {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 5px;
}

.userinfo input[type=text] { 
    width: 70% 
}

userinfo lies in the middle of the page with a width of 60%, however, I am trying to get the textbox within userinfo to be of a certain width relative to userinfo. The above isn’t working. Ideas?

  • 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-26T18:30:07+00:00Added an answer on May 26, 2026 at 6:30 pm

    It sounds like you should assign a percentage width to the search input as well.

    It’s also probably a good idea to keep the search button at a fixed width (although not necessary).

    Edit: Here is an example:

    <div class="widget">
        <input type="text" name="query">
        <input type="submit" name="search" value="Search">
    </div>
    
    <style>
        .widget { width: 30% }
        .widget input[type=text] { width: 70% }
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to make a Radio Button enabled/disabled (not checked/unchecked) via CSS?
Is there a way to make some CSS rules visible only for Opera?
Without using Javascript, is there a way to make a CSS property toggle on
Is there a way in CSS to set the width of any element to
Isn't there a CSS way of having the page to get a border around
Is there any way of pulling in a CSS stylesheet into FireFox 2 or
Is there any way to set a CSS class on an input item in
Is there a way to detect if the display css property of an element
Is there any way to use conditional statements in CSS?
Is there a best way to edit CSS? I'm looking for a designer tool.

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.