I want to show more text on the button when it freezes, and I want the button to decrease and increase with the expanded text.
I need a general solution, since the text on the button and, therefore, its width will depend on the user's choice of language.
This is my (currently not working) attempt
.hover-value {
display: inline-block;
visibility: collapse;
width: 0%;
-webkit-transition: width 2s;
transition: width 2s;
overflow: hidden;
}
button:hover .hover-value {
visibility: visible;
width: 100%;
}
<button>
Result
<span class="hover-value">Add new result</span>
</button>
Run codeHide resultAlso on JsFiddle: https://jsfiddle.net/JohanGovers/46392xss/
I use jQuery and bootstrap in my project, but would like to solve this with css if possible. I tried playing with visibility, as suggested in other SO answers, but to no avail.
Any help would be greatly appreciated.