|
:not
as in:
a:not([href]) { color: inherit; text-decoration:none; }
This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline.
I just thought it was eloquent enough to share.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Huh. Useful in some situations, eh?
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
Thanks for this, Chris, I think there could be a lot more to it than is immediately apparent.
The older I get the better I was
mikeo
|
|
|
|
|
Nice. Are there any (*: doesn't work in browser X) conditions on this? I know the conditional selectors generally don't play nicely with IE.
|
|
|
|
|
BobJanova wrote: Are there any (*: doesn't work in browser X) conditions on this
No support on IE8 and earlier, unfortunately.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Bah... No one uses old browsers like that anyway...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
+5, it's nice to see some wonderful code, as oposed to the waves of weirdos...
EDIT: if you can, make this really a OTD series, as a CSS Selector OTD has really a great potential...
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
|
Thanks for posting this, and to CP for hilighting it in their newsletter email today. This is a pretty cool thing that I had not seen before, probably hidden in plain site right in front of me though.
|
|
|
|
|
Is this what you are using to prevent anchored headings in CodeProject articles from being shown in blue instead of orange?
|
|
|
|
|
yeah
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Non-CSS version - as used in Netscape Navigator 4, Internet Explorer 4, and many later browsers:
<a name=...></a>text to be bookmarked
or
<span id=...>text to be bookmarked</span>
|
|
|
|
|
Empty anchors don't always work. They should. They don't.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|