Let I've an input field like the following:
How can I set cursor postition to the top-left edge of this input field?
Setting the cursor position You can also hold down shift and then move the cursor with the arrow keys on the keyboard to select content. It has the same effect. The TinyMCE bookmarks this location with the Bookmark Manager API, and then loads the selected location later.
Add the text-align property set to “right” for the input.
This should work
input {
padding-top: 0;
padding-left: 0;
line-height: 1em; // this probably doesn't matter
}
It seems that you likely have padding of like 40px 0
or something. So the top and bottom has a lot of space (padding) on the top and bottom.
EDIT:
If that didn't work, you likely have a height
set for your input, which is bad. Since an input is intended to only be one line. If you want multiple lines you are to use <textarea></textarea>
tags instead of <input>
If you don't want to use <textarea>
but have a bigger height for some reason, remove the height from your input and just use padding like this
http://jsfiddle.net/PVRp4/
input {
padding: 0 0 400px 0;
}
Textarea or big size text input ? Input is for single line element use <textarea></textarea>
. Code pls ...
Remove all whitespace between <textarea></textarea>
or <input></input>
tags.
Or in your css code you have text-align: center to your parent elements, or somewhere else but its still formating your input. Press f12 in the browser and check the element.
AFAIR there is no option the place the cursor inside of an input field, except left, center, or right. Vertical Alignment isn't possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With