Reputation: 159
I want to centre the text inside a text area; I am trying with the line height, but it doesn't work.
Upvotes: 10
Views: 5860
Reputation: 2549
You could use the contenteditable="true"
attribute on a <div>
and then skin it with CSS.
Here is a link for cross browser compatibility: Reliable cross-browser info on ContentEditable
Upvotes: 3
Reputation: 32202
Hey now you can used input tag
Replace textarea into input tag as like this
and define height
and line-height
Css
input[type="text"]{
line-height:125px;
height:125px;
}
HTML
<input type="text" value="">
Live demo http://jsfiddle.net/MTCrt/
Upvotes: 1
Reputation: 2000
You can use padding only to achieve that, but it's not pretty way to do things. You can also use jQuery to make the padding flexible, instead of just setting it by yourself.
Upvotes: 2