4 ms·
How about something like this: <a href="some-visited-url"> <span class="test"></span> </a> Does the CSS for span.test change if the link is visi
by IgorPartola 17y ago
How about something like this:
<a href="some-visited-url">
<span class="test"></span>
</a>
Does the CSS for span.test change if the link is visited or not?
Also, this will be very awkward when the style you see with your eyes is not the style that is given to JavaScript.
- JeffJenkins 17y agoThat should be fine. If they make selectors that have an a:visited (and whatever else) take the special code paths it should work fine. The style test in your example is going to be uniform across visited and unvisited unless it's something like: a:visited .test { /* sneaky style */ }
- IgorPartola 17y agoThat's exactly my point. If I define: a .test { color: red; } a:visited .test { color: green; } Then I could for example using jQuery do: $('a .test').each(function() { if ( $(this).css('color') == 'green' ) { console.log( $(this).parent().attr('href') ); } }); Is that incorrect?
- onedognight 17y ago| When a web page tries to get the computed style of a link (or any of its sub-elements), Firefox will give it unvisited style values.
- IgorPartola 17y agoAh, there it is.
- arantius 17y agoThey've probably thought about this, but what about siblings? a:visited + .sneakydiv { /* ... */ }