tags:

views:

227

answers:

2

How can I change the font size of text inside the textbox in html.

+11  A: 

For a <input type='text'> element:

input { font-size: 18px; }

or for a <textarea>:

textarea { font-size: 18px; }

or for a <select>:

select { font-size: 18px; }

you get the drift.

Pekka
`select` can render a text box?
Joey
Well, I was not sure what the OP exactly means by text box, so I thought I'd add all relevant elements.
Pekka
Ah, makes sense :-). Side note: You could restrict `<input>` to `text` and `password` types with a selector, too. Won't be liked by older browsers, though.
Joey
@Johannes and, in all honesty, who cares about old browsers? Even MS made an appeal for people to upgrade from IE6, FF does it automatically, nobody uses Opera :-P, and the rest combined barely scratches statistically...
Paulo Santos
@Paulo: IE 6 is still around 10 to 15 percent marketshare. That's a lot more than Opera's two percent. And as a web developer/designer you *should* care. Granted, font size on an input element is a trivial issue and likely not to cause any harm when not working as desired but not caring in general is the wrong thing to do. Locking oneself up in an ivory tower and ignoring reality doesn't make the world any better. It just makes your web sites work worse :-)
Joey
+4  A: 

Learn the basics of Cascading Style Sheets (CSS)

http://www.w3schools.com/css/default.asp

Yada
+1 of course. Very important, I forgot that.
Pekka