Here's my code :
Html:
<button class="btn btn-primary btn-icon" title="Next">>></button>
Css:
.btn-icon:hover::after{
content: " " attr(title);
transition:width 1s ease;
}
I'm just learning css now, and what I'm trying is to achieve a button that shows its text only on hover, doesn't necessarily needs to be through the title attribute, I just thought it was easier and more ARIA-friendly this way.
But the transition is not working, how can I make it show the :after content smoothly?
JsFiddle: https://jsfiddle.net/xpvt214o/121984/
I tried following the linked duplicates, but to be honest I couldn't replicate it.
.btn-icon:after{
content: " " attr(title);
max-width: 0;
}
.btn-icon:hover:after{
max-width: inherit;
transition: 2s ease;
}