Css underline animation left to right
I am trying to replicate this transition from uber.design site: Show The thing is that i am stuck at reversing the transition:
Temani Afif 222k18 gold badges256 silver badges358 bronze badges asked Feb 10, 2019 at 12:00
You can use gradient and adjust
In case you want a continuous animation on hover you can try this:
You can check this answer for more details about how the calculation of the different value is done: Using percentage values with background-position on a linear-gradient Another kind of animation
let's don't forget the basic one:
You can find more techniques here: https://dev.to/afif/100-underline-overlay-animation-the-ultimate-css-collection-4p40 Another related article: Cool Hover Effects That Use Background Properties answered Feb 10, 2019 at 12:07
Temani AfifTemani Afif 222k18 gold badges256 silver badges358 bronze badges 2 You'll need your pseudo element to be absolute positioned and use the :not selector to reproduce this effect.
answered Feb 10, 2019 at 12:06
Quentin VeronQuentin Veron 2,8311 gold badge12 silver badges29 bronze badges 3 The easiest solution of all, without :not selector or gradients, is to switch between right and left positions such as in the code.
answered Sep 12, 2021 at 10:06
How do you underline left to right in CSS?Left to right
First we need to create a link with the class of left. The next effect will slide the underline in from the left of the link to the right. This works in a similar way to the middle above effect by adding a new element by using the pseudo :before . Instead of using scaleX we need to set the width to 0.
How do I make an animate left to right in CSS?To do that we need to change the transform around it's y-axis. Note that if we make it turn around only at 50% it will slowly turn around at the same time it's moving. So we need to specify how long the potato should be at -webkit-transform: rotateY(0deg); .
How do you underline an animation in CSS?HTML-CSS: Hover underline animation. Use display: inline-block to make the underline span just the width of the text content.. Use the :after pseudo-element with width: 100% and position: absolute to place it below the content.. Use transform: scaleX(0) to initially hide the pseudo-element.. How do I change the underline width in CSS?You cannot modify the width of underline tag. Instead go for Border-bottom approach and change it's properties as required.
|