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
2010-01-22 12:56:50
`select` can render a text box?
Joey
2010-01-22 12:59:19
Well, I was not sure what the OP exactly means by text box, so I thought I'd add all relevant elements.
Pekka
2010-01-22 13:00:52
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
2010-01-22 13:01:50
@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
2010-01-22 13:05:57
@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
2010-01-22 13:22:59