Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How to get text to go to top

I have an HTML input field whose height I extended to be complimentary to the page, but when typing, the text still appears in the center of the box rather than at the top of its enlarged state. I want to know how I can get it to the top, like it is in the box this question was written in, or in the answer box below.

2 Answers

This is the piece of code, I think it will help

#rant-input {
   float: left;
   height: 150px;
   width: 1350px;
   border-radius: 5px;
}
<input type = text id = rant-input>
Steven Parker
Steven Parker
229,744 Points

As the MDN documentation page says: "<input> elements of type text create basic, single-line inputs."

For multi-line input the <textarea> element would be a better choice, and the input in it aligns to the top by default:

<textarea id="rant-input"></textarea>

Youve saved me yet again Steven, thanks.