How would you invoke tooltips?
-
How would I use a title to invoke the tooltips built in the system?
-
-
Actually I chose to do it in pure CSS using data attributes.
-
@trevor Is CSS able to display (data-)attributes somehow? Or do you mean pre-parsing with JS and display the stuff on
:hover
-
Yeah, just CSS, no JS necessary. As a matter of fact, I like doing it this way over JS.
For example;
We'll put
data-anything
in<span data-anything="Blah"></div>
We will hide the content until hovered on and use:before
&:after
to show the tooltip. The trick is styling it, but its pretty simple and straightforward. -
@trevor Ah, haven't worked with dynamic contents in CSS yet. What I didn't know was that the
content
CSS-attribute accepts sth likeattr(myattribute)
.
pretty neat for some use-cases like the tooltipsMaybe my english isn't good enough but I don't understand your original question then.
Do you want to know how we do tooltips on our web-projects?
Do you need ideas to style the:before
pseudo-element in a neat way?
What do you mean with system and title? Do you mean the title-attribute and their native browser-supported tooltips?