Vertical text positioning in the <input> field
I was unable to specify the vertical position of the text in the input field using a space or line height. The following code SHOULD visualize text input with text shifted down:
<input style="padding: 50px 0 0 0; height: 0px;" type="text" value="Hello" />
Instead, all text is centered vertically at the input with a height of 50 pixels.
Any thoughts on how to resolve this?
+3
1 answer
You cannot do this in a standard text box without the complexity of an odd move (for example, creating a div with a border that looks like a text box and removing the border from the text box itself and positioning it vertically at the bottom of the div), so you have to resort to to the textarea element ...
<textarea style="padding: 50px 0 0 0; resize: none;">Hello</textarea>
( resize: none; )
+1