Forum : Resizing input text box width using external CSS
Brief description  about Online courses   join in Online courses
View Bikash Kumar Singh 's Profile

Resizing input text box width using external CSS

I had to use inline CSS to resize the width of input textbox. Please see the following code. Is there a way I can put the style inside the login2 ID or any other way.

#login2{

margin-bottom:10px;

}

<div id="login2"><input type="text" name="" style="width:100px" /></div>
Asked by Bikash Kumar Singh | Sep 3, 2009 |  Reply now
Replies (2)
View bikash kumar singh 's Profile
You are right but just think, what if we define width like this and someday we need to change it to a different value?. Its better to have it defined at one place may be in an id or a class and use that particular class whereever required. With this, if there are any changes in near future we just have to make changes at one place rather to scanning the whole page and make the change, infact thats one reason we are using external CSS.
Sep 4, 2009
View navneet khanna 's Profile
Hi Bikash
There is no need to use style inside input tag. We have width and height property to set the text box height and width.

<input type="text" name="" width="100" />

I hope it solves your problem.
Regards
Sep 4, 2009