Design comparison
Solution retrospective
I'm pretty sure that a lot of the CSS added to size and/or align certain things is not the most optimized solution, if anyone could give me some feedback on that I'd appreciate it!
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, awesome work on this one. Layout in general looks great but the layout is not responsive in terms of scaling right now.
Sebastian Breit already gave great idea, just going to add some suggestions on this as well:
- Don't style the
html
element, remove those and place them inside thebody
tag. You don't usually style thehtml
element except forfont-size
andbox-sizing
. - Also, it would be great to have these base stylings:
html { box-sizing: border-box; font-size: 100%; } *, *::before, *::after { box-sizing: inherit; }
It would be long for me to explain this but trust me on this one, this would make handling the element easier than not setting the styling. You can search about it on this one.
- Always have a
main
element to wrap the main content of your site. On this one, your#container
should be usingmain
instead ofdiv
. - Do not use
margin
to center the component, what you could do is that, remove themargin
on the#container
and on thebody
tag add:
align-items: center; display: flex; flex-direction: column; justify-content: center; margin: 0; min-height: 100vh;
This will make the layout always be centered dynamically. Also, always to set that
margin: 0
on thebody
tag since by default there is an extramargin
on thebody
.- When using
img
always include thealt
attribute on it. If you don't add this, screen-reader would read the source path of the image which you don't want, either thealt
is empty or not, include it always. - Do not use too many or just avoid in general using
id
attribute especially when using it as a styling selector, useclass
instead ofid
when selecting selector. - Same for music icon,
alt
is missing. annual plan
could use a heading tag likeh2
, since it gives overview on what the section would contain.- Do not just use
span
to wrap a text-content, always wrap with meaningful element likep
tag, or wrap thespan
with ap
tag.
Aside from those, great work again on this one.
Marked as helpful1@AlishaSoPosted about 3 years ago@pikamart This was really useful, thank you so much!! I'm working on the FAQ accordion project now, and will try to implement this on that 😊
1 - Don't style the
- @SebastianBr11Posted about 3 years ago
Instead of adding so much padding to the button, you could make the parent display flex and flex-direction column, so that the button automatically goes full length. You would then probably also have to add padding to the container and instead of adding the margin to each component separately you could add a flex gap.
Marked as helpful1
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