i tried now for a long time to get this to work. the “line” under “Mehr erfahren” should go from 0% to 100% but i goes from 100% to 0%. Can anyone find the mistake?
/* DEBUG */
.lwb-col {
transition: box-shadow 0.5s ease;
}
.lwb-col:hover{
box-shadow: 0 15px 30px -4px rgba(136, 155, 166, 0.4);
}
.lwb-col--link {
font-weight: 500;
position: relative;
display: inline-block;
}
.lwb-col--link::after{
border-bottom: 2px solid;
bottom: -3px;
content: "";
display: block;
left: 0;
position: absolute;
width: 100%;
color: #E5E9EC;
}
.lwb-col:hover .lwb-col--link::after {
border-color: #57B0FB;
display: block;
z-index: 2;
transition: transform 0.3s;
transform: scaleX(0);
transform-origin: left center;
}
<div class="lwb-col">
<h2>Webdesign</h2>
<p>Steigern Sie Ihre Bekanntheit im Web mit individuellem & professionellem Webdesign. Organisierte Codestruktur, sowie perfekte SEO Optimierung und jahrelange Erfahrung sprechen für uns.</p>
<span class="lwb-col--link">Mehr erfahren</span>
</div>
2
Answers
EDIT: I moved the
border-bottom: 2px solid #E5E9EC;
to.lwb-col--link
, add aborder-bottom: 2px solid #57B0FB;
to.lwb-col:hover .lwb-col--link::after
and use thetransform
property on the normal and hover. It works, but the border-bottom inital, doesn’t disappear, it’s just override.Move
transform: scaleX(0);
to the default state.Add
transform: scaleX(1);
to the hover state.