Responsive Landing Page Using Media Queries and Flex Box
Design comparison
Solution retrospective
Is there a better way to organize my CSS file? If you have any other feedback please do share.
Community feedback
- @pikapikamartPosted almost 3 years ago
Hey, awesome work on this one. The desktop layout looks great, though it would be really nice to have a bit more padding in general since the content right now are too spaced out compared to the design. When resizing the layout, there are issues since the layout gets too squashed. Try going into like 530px on your screen, you will see that the content are squished and the layout in the footer is destroyed. Though the mobile state looks fine.
For some other suggestions, here are some:
- Adding a
max-width
on thebody
along withmargin: 0 auto
. If you zoom out on your screen, you will see that the contents are going out of places and just occupy the full width. Adding themax-width
will help the site's content layout to be placed properly and be controlled. - The
header
andfooter
should be living outside themain
tag so that it will be treated as primary landmark element properly.
<header /> <main /> <footer />
- The primary
header
should only be containing the topmost part of the site where it includes the site-logo, site-links and other controls if there are. The hero-section should be left for themain
tag. The reason is that, we want theheader
to be as reusable so that we could used it on other pages of our site. By including the hero-section in theheader
then we won't be able to reuse it now because we don't want the hero-section to appear on the pages again right. - When using
img
tag, you don't need to add words that relates to "graphic" such as "logo, illustration" and others, sinceimg
is already an image so no need to describe it as one. - If you somehow look again on the images that are used on this site, almost all images except for the site-logo doesn't really give any information at all, meaning these images only serves as decoration on the site. Decorative images should be hidden for screen-reader at all times by using
alt=""
andaria-hidden="true"
to theimg
tag or onlyaria-hidden="true"
if you are usingsvg
instead ofimg
tag. - Only use descriptive
alt
on images that are meaningful and adds content to the site otherwise hide the image for screen-reader users.
FOOTER
- Same with the company logo, use a more proper
alt
value. - Those 3 icons on the 3 information below the site-logo should be hidden as well using the method mentioned above.
- Those 6 links on the right side, they could be placed inside the
nav
since those are still your website's navigational links right. Also, since they are all related links, using a singleul
would be really nice:
<nav> <ul> li*6 </ul> </nav>
- Each
a
tag that wraps the social-media icon should have eitheraria-label
attribute orsr-only
text inside it, defining where the link would take them. For example, you should usefacebook
as the value if the link would take the user to facebook. - Social-media image should be hidden since it is only a decorative
svg
so usearia-hidden="true"
on it. - Lastly, just addressing the responsiveness issue on the site:>
Aside from those, great job again on this one.
Marked as helpful1@sachdevavaibhavPosted almost 3 years ago@pikapikamart Thanks a lot for taking out your valuable time and write such a descriptive and valuable feedback. I'll surely address the issues and update my code.😇🙏
1@pikapikamartPosted almost 3 years ago@sachdevavaibhav Glad that you find my review useful^^
1@sachdevavaibhavPosted almost 3 years ago@martpika I have addressed almost all the issues you have mentioned. It would be great if you could have a look at it.
1@pikapikamartPosted almost 3 years ago@sachdevavaibhav Sure! Let me just take a quick review on it right now.
- For the
header
part, instead of using theabsolute
on thediv
inside it, use theheader
itself to be theabsolute
so that it will have a height. Try inspecting the site, hover on theheader
and you will notice that it has no height because it's content is out from the flow. - The site-logo is still not using the site's name and is still using the
logo
asalt
value which is not a good value since it is still related to "graphic". - Some
id
is still being used as selector on this, might want to change it toclass
instead.
FOOTER
- The site is not using a proper
alt
value, use the site-name as value. - For the 6 links, you can use the
ul
as suggested to nest the 6 links:
<nav> <ul> li*6 </ul> </nav>
- Each of the
a
tag on the 6 links doesn't need thearia-label
attribute. You usearia-label
to element that has no text-inside it, this will make sure that screen-reader will instead read thearia-label
. It is used as well to make some element be announced on what kind of content it has, it can be use onul
for example to signify that the list has links the site's links inside it. - Each
a
tag for the social-media needs to use thearia-label
and not thesvg
, so grab that and place it on thea
tag.
Marked as helpful1@sachdevavaibhavPosted almost 3 years ago@pikapikamart Thanks a lot for the valuable feedback. I really learnt a lot from your feedback. I have fixed the issues (please review them) but I did not understand why you mentioned to use classes over id. Once again Thanks a lot!
0@pikapikamartPosted almost 3 years ago@sachdevavaibhav Hey, glad that you found my review usefull^^
For the
id
, the reason is css specificity and reusability.id
can only be used once on an element, this is why class are used so that styling could be reused by some elements.id
as well gives high specificity to a selector, meaning a single.class
could not override the stylings applied to anid
selector.Marked as helpful1@sachdevavaibhavPosted almost 3 years ago@pikapikamart Thanks for the explanation. I am glad to learn from you!🤝
1 - Adding a
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