How to Make Text Box Auto Stretch

A text box can hold one or multiple lines of text. When you add a text box to your Web page, it is set to a specific size by default. Auto-stretching a text box allows you to stretch its width automatically rather than manually. When you set a text box's width to 100 percent, it stretches to the full dimension of its container automatically, whether that container is a page, column or table.

Instructions

    • 1

      Open the HTML file you want to modify in a text editor, such as Notepad, TextPad or WordPad.

    • 2

      Scroll to the BODY tag and place your cursor where you want the text box to go.

    • 3

      Add the following HTML code to stretch a single line text box automatically. Replace "Enter your name" with the information you want users to enter into the text box:

      <form>

      Enter your name: <input type="textbox" style="width:100%" />

      </form>

    • 4

      Add the following HTML code to stretch a multiline text box (text area) automatically. Replace "Enter your comments" with the information you want users to enter into the text area:

      <form>

      Enter your comments:<textarea style="width:100%"></textarea>

      </form>

    • 5

      Save the file to preserve your changes.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured