CSS 3 Module <== Test # ==>
W3C Selectors 18 of 19 of the interactive tests category
Testing Date Revision
:hover with ::selection (ID #165) 2001-11-21 1.0

NOTE: User interaction is required for this test.

Select some of this paragraph, then move your pointing device around. While it is above the paragraph, the selection should be green. While the pointing device is elsewhere, the selection should be silver. The paragraph's border should at all times be a darker colour than the selection's background. Repeat the test with everything selected.

  p { border: solid thick gray; }
  p:hover { border: solid thick green; }
  p::selection { background: silver; color: black; }
  p:hover::selection { background: lime; color: black; }
   <p>Select some of this
   paragraph, then move your pointing device around. While it is above
   the paragraph, the selection should be green. While the pointing
   device is elsewhere, the selection should be silver. The
   paragraph&#39;s border should at all times be a darker colour than the
   selection&#39;s background. Repeat the test with everything
   selected.</p>