Design comparison
Solution retrospective
Hi!
Just completed this project. I'm happy with the end product but would appreciate any feedback for anything you feel could be done better.
I've added a media query for mobile and it looks fine in dev tools but I'm not sure if my method is the most efficient way of approaching this?
Thanks
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, awesome work on this one. Layout in general looks great.
Others already gave their feedback on this one, just going to add some suggestions as well:
- Right now, if you hover on the
html
tag orbody
, you will notice that it has no height since the main component is usingposition: fixed
which takes an element out of the flow. Avoid using this orposition: absolute
. Since you are using this to only center the content, it will be better to do it this way, but first, remove all these properties on the.card
selector:
left top position transform
and on the
body
tag add these:align-items: center; display: flex; justify-content: center; min-height: 100vh; # so that flexbox will have enough height to center vertically
This is more consistent as this will always center the content and you avoided using
position
property on the layout.- Vector image should be hidden since it is only decoration. Decorative image must be hidden at all times for screen-reader users by using
alt=""
and extraaria-hidden="true"
attribute on theimg
tag. - Also when using
alt
attribute, avoid using words that relates to "graphic" such as "background" and others. Animg
is already an image/graphic so no need to describe it as one. - A page must have a single
h1
on a page. Since there are no text-content that are visible that could beh1
, you will make theh1
screen-reader only text. Meaning this will be hidden for sighted users and only be visible for screen-reader users, search aboutsr-only
stylings and see how it is used. Theh1
text should describe what is the main content is all about, thish1
would be placed as the first text-content inside themain
element.Have a look at this simple snippet of mine implementing the sr-only heading tag. I already added some comments in the markup so that it will be easy to understand^^. - Music-icon should be hidden as well using the method I mentioned.
- When wrapping a text-content do not just use
span
to wrap it, use meaningful element like ap
tag if it just a regular text or heading tag if it is an heading. annual-plan
could use a heading tag since it gives information on what the section would/could contain, hence the pricing for such plan the user has chosen.
Aside from those, great job again on this one. If you have any queries just let me know.
Marked as helpful0@GitNuttsPosted about 3 years ago@pikamart Appreciate the detailed response. I've now updated my code.
Can you explain why it's not ideal to use
position
?Thanks
0@pikapikamartPosted about 3 years ago@GitNutts Hey. Well not idea if you are going to use
position: absolute
orpositiont: fixed
on a large element.Because like what I suggested above, if you inspect the layout, you don't have any height because the main content is out of the flow because of
position: fixed
.You can use those position for example, a navigational dropdown right, you will need to use
position: absolute
orposition: fixed
for those.Marked as helpful0 - Right now, if you hover on the
- @kens-visualsPosted about 3 years ago
Hey @GitNutts 👋🏻
I have some suggestions to help you fix the accessibility issues and some other things.
- In HTML,
<div class="card">...</div>
should be<main class="card">...</main>
. This will fix the accessibility issues, just, don't forget to generate a new repot once you fix the issues. - For the music icon, add
aria-hidden="true”
, because it's for decoration. You can read more aboutaria-hidden
here. - Also, I suggest adding
transition: all 0.2s;
to the button and the links, this will make:hover
smoother
I hope this was helpful 👨🏻💻 and to answer your question, yes, your approach is good enough, but I'd suggest learning mobile first approach of building websites. That's more efficient and, a lot easier than, the traditional approach (desktop first). Other than that, you did a great job for the first project, keep it up. Cheers 👾
Marked as helpful0@GitNuttsPosted about 3 years ago@kens-visuals Thanks for the help. Just wondering why it still says I've got 3 accessibility issues even though I've changed my code and generated a new report?
0@kens-visualsPosted about 3 years ago@GitNutts sometimes changes take place a bit later than expected, I suggest trying to generate a new report tomorrow.
Marked as helpful0 - In HTML,
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