PDA

View Full Version : Input text size



alfirdaous
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

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

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

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

alfirdaous
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
http://s22.postimg.org/qtteh3utd/Opera.png

Firefox preview;
http://s21.postimg.org/66kxqrvd3/Fire_Fox.png

r-senior
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:



<html>

<head>
<style>
input[type=text] {
font-size: 14pt;
font-weight: bold;
color: red;
}
</style>
</head>

<body>

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

</body>
</html>


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.

https://en.wikipedia.org/wiki/Cascading_Style_Sheets

alfirdaous
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