visited-in-visited-compound-ref.html (463B)
1 <!DOCTYPE html> 2 <title>Behavior of :visited with a compound subject selector (ref)</title> 3 <style> 4 :visited > #inner { color: red; } 5 </style> 6 <a href="" id=outer>Visited1</a> 7 <script> 8 window.onload = () => { 9 // Use script, since the parser can't produce this. 10 let inner = document.createElement('a'); 11 inner.setAttribute('href', ''); 12 inner.setAttribute('id', 'inner'); 13 inner.textContent = 'Visited2'; 14 outer.append(inner); 15 } 16 </script>