Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I didn't have time to try my solution in IE (leaving work now) but you can play around with this if you want: <a href="http://pastie.org/581472" rel="noreferrer">http://pastie.org/581472</a></p> <p><strong>Update:</strong> Took a quick look in IE6-8 and it didn't work in any of them. Not sure if it's cause of the minimal HTML5 document or something else, I'll take another look at it later today or tomorrow.</p> <p><strong>Update 2:</strong> Updated the code to work with FF 3.5, Opera 9, Safari 4, IE6-8 (and probably more and earlier versions, but that is not tested). <a href="http://pastie.org/581636" rel="noreferrer">Grab the updated code</a>.</p> <pre><code>&lt;!doctype html&gt; &lt;title&gt;Background text inside text input control&lt;/title&gt; &lt;style&gt; form { position: relative; } input { background: transparent; position: relative; text-indent: 28px; z-index: 2; } span { color: #999; font-size: 14px; left: 5px; position: absolute; top: 3px; z-index: 1; } &lt;/style&gt; &lt;form action="" method="post"&gt; &lt;input type="text"&gt; &lt;span&gt;US$&lt;/span&gt; &lt;/form&gt; </code></pre> <p>Updated code:</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8"&gt; &lt;title&gt;Background text inside text input control&lt;/title&gt; &lt;style&gt; form { position: relative; } input { padding-left: 28px; } span { color: #999; font-size: 14px; left: 5px; position: absolute; top: 3px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="" method="post"&gt; &lt;input type="text"&gt; &lt;span&gt;US$&lt;/span&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload