Reputation: 468
I have an issue with vertical aligning text in an input box. I already tried display:table-cell
. But when I enter space, instead of jumping a line, it goes to the right. Its for multiple lines, not just one line.
<div class="bodytext">
<div class="vertical">
<input type="text">
</div>
</div>
Upvotes: 0
Views: 2614
Reputation: 419
try adding line-height
or padding
to input, or if you can share your css or make a fiddle.
Upvotes: 0
Reputation: 2267
Is this what you mean? Now the text is vertically centered in the textbox.
.bodytext{
width: 100%;
height: 100px;
background-color: #eee;
}
.bodytext .vertical input{
height: 50px;
}
<div class="bodytext">
<div class="vertical">
<input type="text">
</div>
</div>
Upvotes: 1