@0xabdulkhaliq
Posted
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.
CSS 🎨:
- Let me explain, How you can easily center the component for better layout without usage of
absolute
positioning.
- We don't need to use
absolute
to center the component both horizontally & vertically. Because using `absolute' 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
.card {
position: absolute;
margin-top: 50%;
}
HTML 🏷️:
- This solution lacks semantic markup, which causes lacking of landmark for a webpage and allows accessibility issues to screen readers
- What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like
<div>
or<span>
. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
- For example:
- The
<main>
element should include all content directly related to the page's main idea, so there should only be one per page - The
<footer>
typically contains information about the author of the section, copyright data or links to related documents.
- The
- So fix it by replacing the
<div class="card">
element with the semantic element<main>
in yourindex.html
file to improve accessibility and organization of your page.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
@NugyTomas
Posted
Good morning @0xAbdulKhalid !
Thanks alot for the help I really appreciate it. I will try to fix this as soon as possible.
@0xabdulkhaliq
Posted
@NugyTomas Glad you found it helpful ! 🤠