Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It works for IE and chrome. Only firefox doesn't seem to be working for me.</p> <p>The only way I know of to fix that in firefox is like this (just wrapping the textbox inside a div with the correct padding)</p> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;% padding&lt;/title&gt; &lt;style&gt; html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { margin:0; padding:0; border:none; } div.content { width:50%; margin:0 auto; background:#eee; } div.content form { width:100%; } div.content form ul { list-style:none; margin:0; width:100%; } div.content form li { position:relative; margin-bottom:20px; height:64px; width:100%; /* width is declared */ } div.content form li label { position:absolute; width:auto; left:0; top:0; line-height:20px; } div.content form li .text { position:absolute; bottom:0; left:0; padding:10px 2%; /* if 2% is changed to 2px the padding works correctly */ width:96%; font-size:14px; outline:1px solid #ccc; } div.content form li .textbox { position:absolute; bottom:0; left:0; padding:10px 2%; /* if 2% is changed to 2px the padding works correctly */ width:96%; font-size:14px; outline:1px solid #ccc; border:1px solid #ccc; background-color:white; } .textbox { width:100%; border:solid 1px white; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="content"&gt; &lt;form action="" method="get"&gt; &lt;ul&gt; &lt;li&gt; &lt;label for="text"&gt;Input&lt;/label&gt; &lt;div class='text'&gt; &lt;input type="text" class="textbox" name="text" value="" /&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;label for="text"&gt;Input&lt;/label&gt; &lt;div class='text'&gt; &lt;input type="text" class="textbox" name="text" value="" /&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;label for="text"&gt;Input&lt;/label&gt; &lt;div class='text'&gt; &lt;input type="text" class="textbox" name="text" value="" /&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
 

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