The :target CSS Trick (bitsofco.de)
almost 7 years ago from Ire Aderinokun, Designer, Developer
almost 7 years ago from Ire Aderinokun, Designer, Developer
My biggest issue with this is it appends to the browser history which means if you'll need to press the back button twice to get out of the page.
Yes that's definitely an issue I mentioned in the article as well. It's just a matter of weighing if it's worth it for the functionality
Neat! I was also impressed with your other article:
https://bitsofco.de/5-lesser-used-css-selectors/
":empty"... who knew...
Thank you
You can do a very similar thing using the :focus pseudo-element (and it doesn't affect browser history): http://joshnh.com/weblog/heres-a-neat-trick-using-the-focus-pseudo-class/
That's neat, but we can't apply :focus to just any element so it won't work for some of the examples I mentioned in my article.
The examples in this post are kind of genius. Will definitely use this trick as a fallback for when JavaScript isn't available.
Wow thank you! :)
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now