Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not entirely sure what you mean by "best practice", but one thing I'd improve are the semantics. You could (should?) use <code>&lt;fieldset&gt;</code>'s instead of a, rather meaningless, <code>&lt;div&gt;</code>.</p> <p>And you don't need to use two <code>&lt;div&gt;</code>'s around the <code>textarea</code>, or even multiple background images on a single <code>&lt;div&gt;</code> (which is a CSS3 property, and not widely-supported).</p> <p>Instead, you should wrap the <code>&lt;textarea&gt;</code> in a <code>&lt;label&gt;</code> element, and nest your background-images as I've described below:</p> <p>Try this:</p> <pre><code>&lt;fieldset class="expandableInput"&gt; &lt;label&gt; Semantic text: &lt;textarea&gt;&lt;/textarea&gt; &lt;/label&gt; &lt;/fieldset&gt; </code></pre> <p><em>Bonus: wrapping form elements in <code>&lt;label&gt;</code>'s like this, affords a larger click area, for the user to gain focus on the form element at hand. Just be wary of <code>&lt;select&gt;</code>'s, which doesn't play nice (even though it's valid HTML)</em></p> <p>The CSS would be something like:</p> <pre><code>.expandableInput {background: url(/path/to/first/img);} .expandableInput label {display: block; background: url(/path/to/second/img);} .expandableInput textarea {display: block; margin-top: 3px; background: url(/path/to/third/img);} </code></pre> <p>Also; For consistent looks on form elements, in every browser &amp; platform, I can highly recommend Nathan Smith's <a href="http://formalize.me/" rel="nofollow">Formalize CSS</a> (it requires JS for HTML5 support in older browsers).</p>
    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