Reputation: 1012
I've searched a lot, but still cant find a way to use CSS3 Selectors to style all words starting with a #... Like #diy. Shouldnt that be possible using css-only?
Upvotes: 2
Views: 2472
Reputation: 138017
No, but it can quite easily be done with JavaScript.
Using Extend jQuery.highlight to highlight regular expressions:
$('body').highlight(/\B#\w+/)
Working example: http://jsfiddle.net/kobi/ttd9r/
Upvotes: 0
Reputation: 723648
Selectors aren't designed for selecting text content directly in part or in full, so no, it shouldn't.
Selectors are designed for matching elements. If you want to style hashtags differently, you should be wrapping them in their own elements and then styling those elements.
Upvotes: 3