There is a lower bound on the text, how to make it smoothly increase when moving from the center of a word to its edges?
So it should be, in the final result.
Thank you in advance!
There is a lower bound on the text, how to make it smoothly increase when moving from the center of a word to its edges?
So it should be, in the final result.
Thank you in advance!
Use the pseudo-element and compress-expand it in width when hovering:
Through transform :
.link{ text-decoration:none; position:relative; } .link:before{ position:absolute; bottom: -10px; content: " "; border-bottom: 1px solid #ccc; transform: scale(0,1); width:100%; transition: transform 0.3s } .link:hover:before{ transform: scale(1,1); } <a class='link' href='#'>Ссылка</a> Through width :
.link{ text-decoration:none; position:relative; } .link:before{ position:absolute; bottom: -10px; content: " "; border-bottom: 1px solid #ccc; left:50%; width:0%; transition: all 0.3s; } .link:hover:before{ width:100%; left:0% } <a class='link' href='#'>Ссылка</a> Source: https://ru.stackoverflow.com/questions/631757/
All Articles