admin管理员组文章数量:1434924
I have a login form, with username and password input fields.
These boxes have shadows, and when you click the box, the cursor blinks in the shadow and you can barely see it.
I want someone to click in the text box and have the cursor blink at a 3px indent from the left of the text box. How do I do this? Thanks!
I have a login form, with username and password input fields.
These boxes have shadows, and when you click the box, the cursor blinks in the shadow and you can barely see it.
I want someone to click in the text box and have the cursor blink at a 3px indent from the left of the text box. How do I do this? Thanks!
Share Improve this question edited Jun 9, 2012 at 16:59 Mike B 32.1k13 gold badges89 silver badges113 bronze badges asked Jun 9, 2012 at 16:56 EddieEddie 1794 silver badges14 bronze badges 05 Answers
Reset to default 3Does your input have a class on the css file? If yes, you should add the element padding-left: 3px;
to that class.
If not, you should add style="padding-left: 3px;"
to the input tag in your html.
You can add padding-left: 3px;
to the input box's style. Keep in mind that if you want the input box width to stay the same, you'll want to subtract 3px from its width as well.
Add this to your textboxes:
style="padding-left: 3px"
Or this:
style="text-indent: 3px"
Using a padding would be the best way. style="padding-left: 3px;"
You can do this using the text-indent
css property.
<input style="text-indent:16px"/>
本文标签:
版权声明:本文标题:javascript - How can I indent the text, and starting position of cursor, in a TextBox (user, password, etc..) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744103251a2590959.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论