I have an input with height: 250px as you can see in it's text is in center. Is there any way to place align it to top left corner?
#messageBox
{
width: 200px;
height: 250px;
}
<input id="messageBox">
Or if you need input and you don't need more rows, you can use padding instead height.
For example this code, but it's look crazy:
#messageBox {
width: 200px;
padding: 0 0 250px 0;
}
<input id="messageBox" value="test">
Maybe add padding and let the height auto compute.
I assume that you know about textarea.
However, if you want the single line input field to have a tall box for design
purposes, it can be done.
Design Note: This styling allows you to place a background image below the text input area without having to add extra mark-up, which may be useful at times.
#messageBox
{
width: 200px;
padding-bottom: 250px; /* approximately... */
background: 0 30px no-repeat url(http://placekitten.com/1000/500);
}
<input id="messageBox" value="Test">
html
<textarea id="messageBox"></textarea>
css
#messageBox
{
width: 200px;
height: 250px;
resize:none
}
You should use the textarea element instead.
<textarea id="messageBox"></textarea>
You can use the <textarea> element to achieve this.
typeattr of you input? this is not a valid markuptypeis not supplied, or not recognised by the browser, then it defaults totype"=text". See:<input />.