Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change size of text in text input tag?

Tags:

html

css

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?

like image 237
Dragan Marjanovic Avatar asked Apr 28 '12 12:04

Dragan Marjanovic


People also ask

How do you change text size in input?

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.

How do I increase text size in a tag?

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.

Which tag is used to change the text size?

The <font> tag was used in HTML 4 to specify the font face, font size, and color of text.

How do you set the width and height of an input type 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.


2 Answers

<input style="font-size:25px;" type="text"/>

The above code changes the font size to 25 pixels.

like image 70
nullpotent Avatar answered Oct 06 '22 00:10

nullpotent


In your CSS stylesheet, try adding:

input[type="text"] {     font-size:25px; } 

See this jsFiddle example

like image 36
jacktheripper Avatar answered Oct 06 '22 00:10

jacktheripper