Andrew
Andrew

Reputation: 3999

Align text to top in html?

My code:

<div>
<input type="textarea">
</div>

How can I align text to the horizontal center and vertical top of the textarea?

Upvotes: 1

Views: 286

Answers (3)

anglimasS
anglimasS

Reputation: 1344

Just put,

HTML

<textarea>some words</textarea>

CSS

textarea
 {
    text-align:center;
}

Upvotes: 0

Maverick
Maverick

Reputation: 3059

Like Dave mentioned there is no supported type="textarea" attribute for the input field. I think you want <textarea> like this:

<textarea class="alignCenter"></textarea>

.alignCenter {
    text-align:center;
}

Fiddle link: http://jsfiddle.net/Jt34H/

Upvotes: 5

Jimmy Geers
Jimmy Geers

Reputation: 742

The styling of a Text-area is very limited. You could try us this openWYSIWYG

Upvotes: 0

Related Questions