osos osos - 24 days ago 7
CSS Question

How to change the size of the input text box?

How can i change the box size of the input of type text

<input type="text" id="text" name="text_name" />


Can i do that with editing css ?

Answer

You could set its width:

<input type="text" id="text" name="text_name" style="width: 300px;" />

or even better define a class:

<input type="text" id="text" name="text_name" class="mytext" />

and in a separate CSS file apply the necessary styling:

.mytext {
    width: 300px;
}

If you want to limit the number of characters that the user can type into this textbox you could use the maxlength attribute:

<input type="text" id="text" name="text_name" class="mytext" maxlength="25" />