Responsive Design Using HTML and CSS || No Javascript
Design comparison
Solution retrospective
I didn't use any javaScript because I'm still just starting out :)
I tried using gap in my flexbox container but it didn't work so I had to make do with margins. Could there be a reason why?
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there π. Congratulations on successfully completing the challenge! π
- I have other recommendations regarding your code that I believe will be of great interest to you.
iMAGES πΈ:
alt
text is a descriptive text attribute added to an HTML image tag that provides a textual description of an image for users who are visually impaired or cannot see the image for any other reason.
- The purpose of
alt
text is to convey the meaning and context of an image to these users so that they can understand the content and information conveyed by the image.
- But here, The
svg's
are just used as a decoration material.
- Meanwhile it also needs an
alt
attribute withempty
value
- Eg:
<img src="./assets/images/icon-reaction.svg" alt="">
CSS π¨:
- Looks like the component has not been centered correctly. So let me explain, How you can easily center the component without using
margin
orpadding
.
- We don't need to use
margin
andpadding
to center the component both horizontally & vertically. Because usingmargin
orpadding
will not dynamical centers our component at all states
- To properly center the component in the page, you should use
Flexbox
orGrid
layout. You can read more about centering in CSS here π.
- For this demonstration we use css
Grid
to center the component
body { min-height: 100vh; display: grid; place-items: center; }
- Now remove these styles, after removing you can able to see the changes
.container { margin: 10vh auto; }
- And another thing that you used
40vw
forwidth
of.container
, usingvw
in components may cause sizing issues. Instead40vw
i recommend you to apply40em
which provides better sizing for the component's layout
- Now your component has been properly centered
.
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0@mannyAndemPosted over 1 year ago@0xAbdulKhalid
Thanks a lot for the detailed feedback Abdul.
I'd implement these going further :)
0 - @9CB5Posted over 1 year ago
The property
justify-content: space-between
is overriding yourgap
because it is evenly spreading all child elements inside the parent container. If you want to see the effect of thegap
property then either remove/changejustify-content: space-between
or set a highergap
value (e.g. 3rem).Marked as helpful0 - @ailight360Posted over 1 year ago
Hi, congrats?? on completing the challenge. Better take care about following points.
- Always check Frontendmentor Report Generator issues after submitting the project for removing errors and warnings. To avoid accessibility issue.
- An**"img"** element must have an "alt" attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images.
- This approach creates accessibility error reports, "All page content should be contained by landmarks" is due to non-semantic markup, which results in a webpage without a landmark.
- So fix it by replacing the <div class="container"> element with the semantic element <main> along with <div class="attribution"> into a <footer> element in your index.html file to improve accessibility and organization of your page.
To used gap in a flex remove high
height: 50%; justify-content: space-between; }
1@mannyAndemPosted over 1 year ago@ailight360
Thanks, I'd try writing more semantic markup from now on.
0
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