![]() ![]() Next, we create a :before pseudo-element that will contain a content attr() function and its specification.You can style this however you like, but for sake of the demo we use a dotted border-bottom. We use the tooltip class to specify which element is going to be the tooltip. ![]() The way it works is quite simple, let me explain the code below: Thankfully, that can be circumvented using attr(). I wanted to add a tooltip function to my WordPress blog, but doing so would require using a plugin that adds unnecessary bloat to my site. The attr() property is one of my favorite recent discoveries. You can use this template and save it as index.html: I have provided sample templates that you can import directly into your projects. The only requirement is that you know a bit of CSS & HTML. Want to add an icon to a button? Get a plugin. The way WordPress works is that you need to use a plugin for almost everything. And during that time, I must have written 10,000+ lines of CSS to customize various theme designs.īut, more specifically, I use CSS to overcome the need for plugins. I have been using WordPress for more than 10 years. My inspiration for this article comes directly from my experience of working with WordPress on a daily basis. Properties like is() and where() but also attr() have been around for a while, yet are easily overshadowed by the potential of modern frameworks. In my experience, it’s quite easy to overlook existing features unless you constantly check for updates. Check it out if you hadn’t had the time to catch up yet! Michelle Barker wrote an article for Smashing Magazine discussing the upcoming CSS features. Although not available right now, it does set a precedent for future potential to write conditional logic using CSS. We know that a proposal draft has been made to introduce & statements. The new features being introduced are helping to solidify CSS as a true scripting language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |