View Full Version : Input text size

October 11th, 2013, 02:59 AM
Hello everybody

I am using Ubuntu 12.10 LTS, Firefox browser, while doing the below code, the input text size is too large, eventhough I made it smaller:

<input type='text' name='title' size='15'>

Any idea about this

Thx in advance

October 11th, 2013, 03:48 AM
Could you provide some context? Where are you applying this code?

October 11th, 2013, 07:43 AM
it is only a simple form with the above code

October 11th, 2013, 08:30 AM
Are you styling it with CSS? If so, could you show your complete CSS file?

October 12th, 2013, 02:18 AM
no css applied:

<input type="text" name="test" size="15" maxlength="40" />
<br />
<input type="text" name="test" size="25" maxlength="40" />
<br />
<input type="text" name="test" size="35" maxlength="40" />
<br />

Opera preview

Firefox preview;

October 12th, 2013, 08:57 AM
The size attribute of an input element of type "text" controls the visible width of the text field. If you want to change the size of the font within the text field, you should style it with CSS. For example:


input[type=text] {
font-size: 14pt;
font-weight: bold;
color: red;


<input name="test" type="text" size="15" maxlength="40"/><br/>


This is for illustration only. In a real page, you would probably link to an external stylesheet so that you can use it across multiple pages.


October 14th, 2013, 03:23 AM
What I am looking for, is "size" within "input", not the font-size, the above code did not change anything