Data attributes can also be used for pure CSS tooltips!
<a href="#" data-tooltip="Test tooltip!">Hover me!</a>
[data-tooltip]:hover { position: relative; } [data-tooltip]:hover::before { all: initial; font-family: Arial, Helvetica, sans-serif; display: inline-block; border-radius: 5px; padding: 10px; background-color: #1a1a1a; content: attr(data-tooltip); color: #f9f9f9; position: absolute; bottom: 100%; width: 100px; left: 50%; transform: translate(-50%, 0); margin-bottom: 15px; text-align: center; font-size: 14px; }
add ::focus in the mix and it gets a lot more accessible!
::focus
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Data attributes can also be used for pure CSS tooltips!
add
::focusin the mix and it gets a lot more accessible!