Design comparison
Solution retrospective
First the things I did I used a lot more semantic markup than I ever have. Instead of too many DIVS I used <main>, <section> and <article> I added the media query for the mobile look, and it appears to be working ok.
Issue My main issue is responsive CSS. I have stayed away from PX as much as I can. I have been using %, VH, VW, MIN/MAX width etc. However I am still having issues with its responsiveness.
With this project, it goes out of whack when I zoom in or out. It looks ok at 100% zoom, but it does not look right when zooming in or out.
What is the trick for this? While my CSS understanding has grown I am clearly having some issues understanding it fully
Community feedback
- @VCaramesPosted about 2 years ago
Hey @ColonelSandurz, some suggestions to improve you code:
- Implement a Mobile First approach 📱
With mobile devices being the predominant way that people view websites/content. It is more crucial than ever to ensure that your website/content looks presentable on all mobile devices. To achieve this, you start building your website/content for smaller screen first and then adjust your content for larger screens.
- To give you HTML code structure, you want to set up your code in the following manner (only did parent containers):
<body> <header></header> <main> <section> <div class="supervisor-card"></div> <div class="team-card"></div> <div class="karma-card"></div> <div class="calculator-card"></div> </section> </main> </body>
The Header Element represents introductory content.
The Main Element identifies the main content of the document.
The Section Element can be used to wrap content that is related to each other.
And since none of the cards make sense on their own, a simple Div will do for each card.
-
The icons serve no other purpose than to be decorative; They add no value. There Alt Tag should left blank and have an aria-hidden=“true” to hides it from assistive technology.
-
Your card are warping because you are using vw / vh for their sizing. This will cause your content to expand/shrink indefinitely.
-
Using CSS Grid with Grid-Template-Areas will make things way easier when building the layout; it will give you full control of the layout.
.card-container { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); grid-template-areas: "supervisor team calculator" "supervisor karma calculator"; } .karma-card { grid-area: karma; } .calculator-card { grid-area: calculator; align-self: center; } .team-card { grid-area: team; } .supervisor-card { grid-area: supervisor; align-self: center; }
Happy Coding! 👻🎃
Marked as helpful0@ColonelSandurzPosted about 2 years ago@vcarames Thanks. I played around with this code and yes it was much easier to setup. I have been trying to implement Grid more, I am very new at it but this helps a lot
Thanks
0@VCaramesPosted about 2 years ago@ColonelSandurz
CSS Grid will come in handy for the majority of the challenges, you can also use on micro layouts.
0
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