Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Underlining Text in an <input> Box

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. ^_^

like image 818
bobber205 Avatar asked Sep 10 '10 00:09

bobber205


People also ask

How do you underline a text box?

The quickest way to underline text is to press Ctrl+U and start typing. When you want to stop underlining, press Ctrl+U again.

How do you underline words in coding?

The <u> tag in HTML stands for underline, and it's used to underline the text enclosed within the <u> tag. This tag is generally used to underline misspelled words.


2 Answers

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

like image 171
David Thomas Avatar answered Sep 28 '22 08:09

David Thomas


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

like image 44
Kushal Vaghani Avatar answered Sep 28 '22 07:09

Kushal Vaghani