I am trying to make a logo for header, however I want the last letter to be
inclined.
like this:
and when hovering to be straightened and fall back to it’s default position.
I tried this:
.nav-branding {
text-decoration: none;
color: black;
font-size: 2rem;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.nav-branding span {
display: inline-block;
margin-left: 10px;
margin-bottom: 10px;
transform-origin: bottom center; /* Set the rotation origin to the bottom center */
transform: rotate(-25deg);
}
.nav-branding span:hover {
animation: fallAndBack 1s forwards; /* Play the animation on hover */
}
@keyframes fallAndBack {
0%, 100% {
transform: rotate(-25deg); /* Starting and ending position, same as initial rotation */
}
50% {
transform: rotate(25deg); /* Rotate to the opposite direction at 50% */
}
}
<a href="/" class="nav-branding">BARRETT<span>E</span></a>
But it is a little broken and whatever I do it gets worse can someone help.
Thank you in advance! <3
2
Answers
Add this instaed of that default animation
I’m not sure what you mean by broken or getting worst. However, I’ve tried the following settings and looks pretty close to the image you provided.