Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

Huddle landing page with curved sections

Younes Adjoudj•240
@younesadjoudj
A solution to the Huddle landing page with curved sections challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi guys! To add the curved style to sections, I used the pseudos elements ::before and ::after (you can see the code right below here), it worked, but I struggled to do it but it's not really 100% responsive, I had to adjust by adding a height in absolute units (px) to fix everything. If you know a better, simpler and more responsive way, I'm interested. Thank you

/* Waves (curves) styling */
.grow, .users, footer {
    position: relative;
}

.grow::before, .grow::after, 
.users::before, .users::after,
footer::before {
    content: '';
    width: 100%;
    position: absolute;
    left: 0;
    background-repeat: no-repeat;
    background-size: cover;
}

.grow::before {
    height: 250px;
    bottom: 100%;
    background-image: url("images/bg-section-top-mobile-1.svg");
    background-position: center;
    margin-top: 4rem;
}

.grow::after {
    height: 150px;
    top: 100%;
    background-image: url("images/bg-section-bottom-mobile-1.svg");
    background-position: center;
}

.users::before {
    height: 120px;
    bottom: 100%;
    background-image: url("images/bg-section-top-mobile-2.svg");
}

.users::after {
    height: 150px;
    top: 100%;
    background-image: url("images/bg-section-bottom-mobile-2.svg");
}

footer::before {
    height: 200px;
    bottom: 100%;
    background-image: url("images/bg-footer-top-mobile.svg");
}
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Younes Adjoudj's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License