How to control text alignment within input?
I have css but how to control text in the input that will be in the middle of input (vertical-horizontal control).
It seems that 22px input will give me text to the top...with font size 12px.
Apply a line-height the height of the input.
Please see what I have. It will bring text not in the middle even I use:
vertical-align:middle; see snap. Is this control correct or my css uses some div where is align TOP...
As KDLA said: use a block element and give it the same height and line-height values
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
border:solid 1px #ff0000;
<div class="mydiv">text here</div>
ok, I understand and have given.
you see text inside input like sample vbvf. I would like to move it in the middle, but it is at the top...this is issue.
Well you are half-right, it works in IE, but it will not work in FF. It looks like FF has not implemented the CSS line-height within the form's textboxes. I guess the only workaround is to give your input a padding-top enough to bring your text in the middle.
Will IE detect padding-top? I think I noticed that sometimes IE and Mozilla show margin and padding different.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)