Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It would be possible to use the 'adjacent sibling selector' if the <code>input</code> was before the <code>label</code>. Just put the <code>input</code> before the <code>label</code>, and then modify the layout to put <code>label</code> before the <code>input</code>. Here's an example:</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; input:focus + label {font-weight: bold} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div style="direction:rtl"&gt; &lt;input type="text" id="username" /&gt; &lt;label for="username"&gt;Username:&lt;/label&gt; &lt;/div&gt; &lt;div style="direction:rtl"&gt; &lt;input type="password" id="password" /&gt; &lt;label for="password"&gt;Password:&lt;/label&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>(It's kind of a hack, I would personally use javascript to do this)</p> <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-css lang-css prettyprint-override"><code>input:focus + label {font-weight: bold}</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form id="form1" runat="server"&gt; &lt;div style="direction:rtl"&gt; &lt;input type="text" id="username" /&gt; &lt;label for="username"&gt;Username:&lt;/label&gt; &lt;/div&gt; &lt;div style="direction:rtl"&gt; &lt;input type="password" id="password" /&gt; &lt;label for="password"&gt;Password:&lt;/label&gt; &lt;/div&gt; &lt;/form&gt;</code></pre> </div> </div> </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