Design comparison
Solution retrospective
.container::before { content: ""; background: url("/images/pattern-background-desktop.svg") center center/contain; position: absolute; width: 100%; height: 26rem; top: 0; left: 0; z-index: -1; } I am able to see the output of the above code in the visual studio live server, but I can't see it in the GitHub live page.
I would like to hear your feedback! π
Community feedback
- @correlucasPosted over 2 years ago
πΎHello Aman, congratulations for your new solution!
Your solution is really good and there's nothing to say about the code, nice that you've used BEM. The value youβve used for the shadow make it too much dark and strong, to create a smooth shadow you need to give it less
opacity
and moreblur
instead try value for example and see the difference between the previous shadow and this onebox-shadow: 5px 5px 12px 5px rgb(0 0 0 / 5%);
If youβre not familiar to box-shadow you can use this site to create the shadow design and then just drop the code into the CSS: https://html-css-js.com/css/generator/box-shadow/
π I hope this helps you and happy coding!
Marked as helpful1@correlucasPosted over 2 years ago@AmanGupta1703 you're welcome Aman, feel free to ask me further questions π
Marked as helpful1 - @ErayBarslanPosted over 2 years ago
Hey there, nice work with your solution! Some suggestions:
- Regarding html structure, you have 3 nested <div> containers which you can achieve the same result by just using one. You can simply remove
.summary-box
without effecting the design. Removing.container
will require little refactoring but you can remove anything related to that. - Using background on container breaks it's design on screen change. Using on body would be better option. After removing these elements from html you can use:
body { ... background: url("/images/pattern-background-desktop.svg"); background-repeat: repeat-x; } .summary-item { ... width: 90%; max-width: 414px; }
As you can see, just adding
max-width
is enough to achieve the same thing. You can also lower the need of media-query by adjusting%
values for the mobile version, then give it amax-width
. This approach is also preventing content overflowing between 375-550px due towidth: 48%
.- Lastly, now we have just
.summary-item
as container, you can use<main>
on it instead div to be semantically right. Aside these good work again and happy coding :)
Marked as helpful1 - Regarding html structure, you have 3 nested <div> containers which you can achieve the same result by just using one. You can simply remove
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