Design comparison
Solution retrospective
Border radius at the top of the page didn't work. I had to use "border-top-left-radius" and "border-top-right-radius" for the hero-image to round it. Not sure if it was the only way to round top corners.
Community feedback
- @MelvinAguilarPosted over 1 year ago
Hello there ๐. Good job on completing the challenge !
-
In your case, you're trying to apply a border-radius to a parent container (<main>), but the child image (<img class="hero">) is overflowing the parent's boundary.
Adding
overflow: hidden;
to the parent container is one way to make sure the child elements follow the rounded corners. It will clip any content or child elements that extend beyond the boundary of the parent container.This would look like:
main { background-color: white; border-radius: 1em; overflow: hidden; /* Added this line */ } .hero { max-width: 100%; /* border-top-left-radius: 1em; */ /* border-top-right-radius: 1em; */ }
I hope you find it useful! ๐
Happy coding!
Marked as helpful3 -
Please log in to post a comment
Log in with GitHubJoin 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