Design comparison
Solution retrospective
Still working on media queries, please can some let me know if I'm setting up my code right for media queries or in general when doing projects like these, I want to get everything right to make doing mobile and desktop right as soon as possible.
Any other tips and comment help.
Community feedback
- @GabrielMontplaisirPosted almost 2 years ago
Hey @Lozzek, your challenge looks nice on the desktop. However, there's still work to do. Keep in mind I'm still learning myself, so take the following with a grain of salt. Feel free to explore my profile for my solution though. That said:
Your HTML
-
I find that semantic HTML elements such as
<main>
&<h1>
don't require classes. In your CSS, you can callmain {}
andh1 {}
and simply give it the style you want. Its class is simply redundant unless you plan to call it multiple times (which you shouldn't do w/main
). Similarly, wrapping these elements around a<div>
is redundant, unless you're boxing multiple elements inside. -
You should use semantic HTML for the verified buyer testimonials. To do so, you'll want to use
<figure>
,<figcaption>
&<blockquote>
. For example:
<figure> <figcaption> <img src="./images/image-colton.jpg" alt="Headshot of Colton Smith" /> <div> <h2>Colton Smith</h2> <span>Verified Buyer</span> </div> </figcaption> <blockquote> <q> We needed the same printed design as the one we had ordered a week prior. Not only did they find the original order, but we also received it in time. Excellent! </q> </blockquote> </figure>
This will allow screen-readers to better access your content.
Your CSS
- Your
.content
has amin-height: 100%
. Why not move this to your CSS reset, and replace the%
withvh
? - Your
background
should contain the position of your images:top left
&bottom right
to be precise. - No need to call styles like
text-align
multiple times. Consider placing it in yourbody {}
ormain {}
, and changing the exceptions when needed. - Only call
@media {min-width: 50em}
once. Everything else can be placed inside. If you plan to play with multiple screen sizes, however, you need to call another@media {min-width: XXem}
and adjust appropriately. - Since your
.box
class usesdisplay: flex;
, you should take advantage of this to position yourbox1
,box2
, andbox3
. Removeposition: relative
and usealign-self
instead. Check A complete guide to flexbox for some additional information. The same can be done with your testimonial boxes. - Your
.box
class (for your reviews) are HUGE! They cause your screen to scroll left & right. Consider adding amax-width
of about 26.6rem to it. In turn, this causes your mobile website to also scroll left & right and not be very accessible or usable.
Let me know if you have any questions or need additional help!
Marked as helpful0 -
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