Sunnyside-Agency Responsive Landing Page using Flexbox and CSS Grid

Solution retrospective
Hello!, I have a question that I would like to receive some help. In the transform and stand out sections, I don´t know how to give that kind of underline to the a href link that says "LEARN MORE".
Please log in to post a comment
Log in with GitHubCommunity feedback
- @David404-dev
You can use the border-bottom property in css for those links and when you hover over those links you can also change the color.
For example:
.learn-more-link { border-bottom: 5px solid pink; }
.learn-more-link:hover { border-bottom: 5px solid orange; }
If you don't want the colors to change instantly, check out the transition property.
Marked as helpful - @alosoft
@Juan2579 You can add the underline by wrapping the link tag with a div container and an empty div below the link
<div class="container"> <a href="#" class="styled_button yellow"> Learn more</a> <div class="yellow_line"></div> </div>
add these styles for the yellow_line and red_line
.red_line, .yellow_line { width: calc(100% + 0.5rem); height: 0.3rem; border-radius: 1rem; bottom: 0; left: 0; right: 0; margin-top: -0.4rem; background: transparent; }
after that you can show the lines on hover with these styles
.styled_button:hover+.yellow_line { background: var(--yellow); } .styled_button:hover+.red_line { background: var(--soft-red); }
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord