I have a large input box for text but I can't change the font size?
<input type="text">
I would like to change the font size inside the text field but I can't seem to do it using CSS. Any help?
To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size. HTML5 do not support the <font> tag, so the CSS style is used to add font size.
In HTML, you can change the size of text with the <font> tag using the size attribute. The size attribute specifies how large a font will be displayed in either relative or absolute terms. Close the <font> tag with </font> to return to a normal text size.
The <font> tag was used in HTML 4 to specify the font face, font size, and color of text.
The height attribute specifies the height of the <input> element. Note: The height attribute is used only with <input type="image"> . Tip: Always specify both the height and width attributes for images. If height and width are set, the space required for the image is reserved when the page is loaded.
<input style="font-size:25px;" type="text"/>
The above code changes the font size to 25 pixels.
In your CSS stylesheet, try adding:
input[type="text"] { font-size:25px; }
See this jsFiddle example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With