Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Order summary component

Jordan 180

@GitNutts

Desktop design screenshot for the Order summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

@pikapikamart

Posted

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 or body, you will notice that it has no height since the main component is using position: fixed which takes an element out of the flow. Avoid using this or position: 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 extra aria-hidden="true" attribute on the img tag.
  • Also when using alt attribute, avoid using words that relates to "graphic" such as "background" and others. An img 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 be h1, you will make the h1 screen-reader only text. Meaning this will be hidden for sighted users and only be visible for screen-reader users, search about sr-only stylings and see how it is used. The h1 text should describe what is the main content is all about, this h1 would be placed as the first text-content inside the main 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 a p 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 helpful

0

Jordan 180

@GitNutts

Posted

@pikamart Appreciate the detailed response. I've now updated my code.

Can you explain why it's not ideal to use position?

Thanks

0

@pikapikamart

Posted

@GitNutts Hey. Well not idea if you are going to use position: absolute or positiont: 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 or position: fixed for those.

Marked as helpful

0
P
Ken 4,915

@kens-visuals

Posted

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 about aria-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 helpful

0

Jordan 180

@GitNutts

Posted

@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
P
Ken 4,915

@kens-visuals

Posted

@GitNutts sometimes changes take place a bit later than expected, I suggest trying to generate a new report tomorrow.

Marked as helpful

0
Dusvy_M 390

@dovelm

Posted

Excellent!!, very good in mobile

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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