Bookmark landing page with FlexBox and JavaScript
Design comparison
Solution retrospective
I'd like to ask about the background figures. What i did was set up a div with an absolute position, and then moved it around. Like this: .header-figure { background: var(--softBlue); position: absolute; bottom: -18px; right: 0; width: 40%; height: 55%; border-top-left-radius: 40%; border-bottom-left-radius: 40%; z-index: -1;
any other or better option? thanks!
Community feedback
- @mattstuddertPosted about 5 years ago
Hey Lucas, great work on this solution! The way that you've done the background pattern is fine. Another way, which would reduce the HTML would be to use a pseudo-element, like
::before
to do the same. For theborder-radius
you can also set a really high pixel value, instead of a percentage to make sure the corners are fully rounded e.g.border-bottom-left-radius: 500px;
.I hope that helps!
1@gomezlucasPosted about 5 years ago@mattstuddert Perfect! I got it now! and it definitely would save some space in the HMTL and make it clearer. Thank you very much!
0@gomezlucasPosted about 5 years ago@mattstuddert hello Matt! thanks for your answer! what do you mean by reduce the html with ::before? Like setting the figure size with that pseudo element? thanks!
0@mattstuddertPosted about 5 years ago@gomezlucas no worries! If you used the pseudo-element then you wouldn't need the
<div class="header-figure"></div>
in your HTML. You would instead do something like this is your CSS:.header-container { position: relative; /* other styles */ } .header-container::before { content: ""; position: absolute; /* other styles */ }
Here's the MDN article on the before pseudo-element for more information.
Let me know if you have any more questions 👍
1
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