I have an HTML tag with a short maxlength but a long value attribute. I'd like the displayed text to show the end (right side) of the text, rather than the start (left side).
<input maxlength=10 value="A really really really long entry goes in here"/>
currently shows:
"A really r"
instead I'd like it to show:
"es in here"
Cheers,
Ian
Do you want the visible area to start from the right? you can use css and the following rule input {direction:rtl;}
rtl
means from right to left
example: http://jsbin.com/ilejo4
PS: the value of maxlength
in your html must be wrapped with quotes, also you have to set the type
of the input
Add style="text-align:right"
to the input tag.
来源:https://stackoverflow.com/questions/4973500/right-align-text-in-html-input-field