Design comparison
Solution retrospective
What would you change about my solution?
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, great work on this one. Layout in general looks great and it is responsive.
Some suggestions would be:
- Right now, your
html
doesn't have width or content. Try to inspect the layout, hover on thehtml
tag, you will notice it don't have a size right, it is because thebody
tag is out of the flow since you useposition: absolute
on it. This is not advisable to use especially on a large element. You should remove this property. - Also on the
body
tag, remove theheight
andwidth
since you don't need it.block
elements by default uses 100% of the width and avoid usingheight: 100vh
as this limits the element's height. Usemin-height: 100vh
instead since this is much flexible. - Those 2
img
that is used as a background, it would be better if they were set at thebody
tagsbackground
property. - Since you are using
margin
to center the#container
element right, instead of this, remove allmargin
on it and on thebody
tag add these stylings:
align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 100vh;
This way, your content is being centered properly. Take note of the
flex-direction
I set it to column since there are 2 elements that are inside the flow inside thebody
tag.- Add an extra
aria-hidden="true"
attribute on the vectorimg
to make it totally hidden. - The
order summary
could have use a heading tag likeh1
for now. Also remember thath1
is needed for every page, a singleh1
. - Music icon could use the
aria-hidden="true"
as well. annual plan
should be a heading since it gives overview on what the section would contain. Also when wrapping text-content, do not just usediv
to wrap it, use meaningful element likep
tag for regular text.
Aside from those, great work on this one. If you have queries, just drop it here okay.
1@saloleviPosted about 3 years ago@pikamart Thank you so much, this is very helpful, I struggled while inspecting since the body for some reason kept occupying just the space of the "content" and I didn't know how to fix that. I'll keep in mind every tip you gave, and I thank you for taking your time to review my code. Just one quick question, what does the aria-hidden property do? And should I add them on the hero and music images?
0@pikapikamartPosted about 3 years ago@salolevi An
aria-hidden
property oraria-hidden="true"
hides an element so that it won't be picked up by other assistive tech like a screen-reader/voice over.You typically add them in combine with
alt
attribute onimg
tag.When using
svg
since there are noalt
right, to hide it you will need to usearia-hidden="true"
.Decorative images should always be hidden at all times using those methods^^
1 - Right now, your
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