<?xml-stylesheet href="../../../style/xhtml-full.css" type="text/css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>:focus with ::selection</title>
  <meta name="author" content="Ian Hickson"/>
  <link rel="stylesheet" type="text/css" href="../../../style/xhtml-full.css"/> <!-- yes this means compliant UAs get to import this twice -->
  <style type="text/css"><![CDATA[
  textarea { border: solid thick gray; }
  textarea:focus { border: solid thick green; }
  textarea::selection { background: silver; color: black; }
  textarea:focus::selection { background: lime; color: black; }
]]></style>
  <link rel="first" href="css3-modsel-18.xml" title=":hover pseudo-class"/>
  <link rel="prev" href="css3-modsel-163.xml" title="Contextual :contains"/>
  <link rel="next" href="css3-modsel-165.xml" title=":hover with ::selection"/>
  <link rel="last" href="css3-modsel-165.xml" title=":hover with ::selection"/>
  <link rel="up" href="./index.html"/>
  <link rel="top" href="../../../index.html"/>
 </head>
 <body>
  <table class="testDescription">
   <tr>
    <th class="b">CSS 3 Module</th> <!-- XXX hard coded to say CSS 3 -->
    <th class="c" colspan="2">
     <a href="css3-modsel-163.xml" title="Contextual :contains">&lt;==</a>
     Test #
     <a href="css3-modsel-165.xml" title=":hover with ::selection">==&gt;</a>
    </th>
   </tr>
   <tr>
    <td class="b">W3C Selectors</td>
    <td class="c" colspan="2">14 of 15 of the interactive tests category</td>
   </tr>
   <tr>
    <th class="b">Testing</th>
    <th class="a">Date</th>
    <th class="a">Revision</th>
   </tr>
   <tr>
    <td class="b">:focus with ::selection (ID #164)</td>
    <td class="a">21-november-2001</td>
    <td class="a">1.0</td>
   </tr>
  </table>
  <p class="WARNING">NOTE: User interaction is required for this test.</p>
  <div class="testSource">
   <div class="testText">
   <p><textarea rows="5" cols="70">Select some of this text, then change the focus around. While this
text is focussed, the selection should be green. While the focus is
elsewhere, the selection should be silver. The border should at all
times be a darker colour than the selection&#39;s background. Repeat the
test with everything selected.</textarea></p>

</div>
   <pre class="rules">
  textarea { border: solid thick gray; }
  textarea:focus { border: solid thick green; }
  textarea::selection { background: silver; color: black; }
  textarea:focus::selection { background: lime; color: black; }
</pre>
   <pre class="rules">
   &lt;p&gt;&lt;textarea rows=&quot;5&quot; cols=&quot;70&quot;&gt;Select some of this text, then change the focus around. While this
text is focussed, the selection should be green. While the focus is
elsewhere, the selection should be silver. The border should at all
times be a darker colour than the selection&amp;#39;s background. Repeat the
test with everything selected.&lt;/textarea&gt;&lt;/p&gt;

</pre>
  </div>
 </body>
</html>