Better “CSS3 ticket-like tags”

Today I stumbled upon this tutorial, which from the screenshot, looked very interesting. So, I read on, and to my horror I noticed the author suggesting some questionable practices, the worst of which was using 3 HTML elements for every tag, including …


This content originally appeared on Lea Verou’s blog and was authored by Lea Verou

Today I stumbled upon this tutorial, which from the screenshot, looked very interesting. So, I read on, and to my horror I noticed the author suggesting some questionable practices, the worst of which was using 3 HTML elements for every tag, including nonsense markup like <span class="circle"></span>.

So, I thought I’d take a chance at trying to recreate this effect without any extra markup. And it turned out to be quite easy, although using CSS gradients limits browser support a bit (IE10, Firefox 3.6+, Chrome, Safari 5.1).

They have the same disadvantage as the originals: They depend on the background color. However, unlike the originals, they come at less code, they’re scalable without changing a million values (as shown in the “bigger” section) and of course, no extra markup.

You can see the results in the fiddle below:

Disclaimer: webdesign tuts+ occasionally has some nice tutorials. I didn’t write this post to attack them in any way.


This content originally appeared on Lea Verou’s blog and was authored by Lea Verou


Print Share Comment Cite Upload Translate Updates
APA

Lea Verou | Sciencx (2011-08-15T00:00:00+00:00) Better “CSS3 ticket-like tags”. Retrieved from https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/

MLA
" » Better “CSS3 ticket-like tags”." Lea Verou | Sciencx - Monday August 15, 2011, https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/
HARVARD
Lea Verou | Sciencx Monday August 15, 2011 » Better “CSS3 ticket-like tags”., viewed ,<https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/>
VANCOUVER
Lea Verou | Sciencx - » Better “CSS3 ticket-like tags”. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/
CHICAGO
" » Better “CSS3 ticket-like tags”." Lea Verou | Sciencx - Accessed . https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/
IEEE
" » Better “CSS3 ticket-like tags”." Lea Verou | Sciencx [Online]. Available: https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/. [Accessed: ]
rf:citation
» Better “CSS3 ticket-like tags” | Lea Verou | Sciencx | https://www.scien.cx/2011/08/15/better-css3-ticket-like-tags/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.