Underlining Text in an <input> Box

2019-04-30 02:54发布

I've gotten a request from a client to underline text in a text field. Both single and double lines.

Is this even possible? I assume with some obscure plugin but I haven't found it yet. :P

I've thought about there being 2 possibilities, if this is possible.

  1. Underlining the text in the actual field.
  2. Doing some crazy hack with text just underneath the text field.

Thanks for any help and/or commentary. ^_^

2条回答
爷、活的狠高调
2楼-- · 2019-04-30 03:33

You could just use a CSS based solution i.e. a CSS selector to underline the text.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-04-30 03:51

The following works in Chrome 6.0.472.55/Ubuntu 10.04, and Firefox 3.6.9 (also Ubuntu 10.04):

input {text-decoration: underline; }

Though this, obviously, gives only a single-underline.

Quick demo at: jsbin

查看更多
登录 后发表回答