@rayaatta
Posted
Hello zainy2401π, congratulations on completing your first FED challenge π
I have some suggestions you might find useful.
1
Try to make your html more Semantic by wrapping the main page content inside a <main>
tag .
Replace
<div class="card" role="main">
With
<main class="card">
.
This changes nothing visually but
Using it is a better alternative to using the aria role when the element for it already exists.
Using semantic markup improves
SEO
And user experience (accessibility) for people using assistive technology such as screen readers.
2
I noticed that you used h2
.since it is the only heading in the document you should replace it with <h1>
.
Here's a quick guide on how to use them:
The <h1>
to <h6>
tags are used to define HTML headings. <h1>
defines the most important heading. <h6>
defines the least important heading. Only use one <h1>
per page - this should represent the main heading/subject for the whole page. Also, do not skip heading levels - start with <h1>
, then use <h2>
, and so on.
You can then style them in you css.
Unlike what most people think, it's not just about the size and weight of the text It is about maintaining a clear and consistent hierarchy through out the document
3 To body, replace
height: 100vh;
with
min-height:100vh;
This prevents content overflowing on short devices or mobile devices in landscape orientation.
4
You used
width: 400px;
On the .card
This is okay but in case a screen is less than 400px wide then the card overflows the view port.
You can make it more responsive by using
max-width:min(90%,400px)
This means it is 400px but on smaller screens it only covers 90% of the width.
I hope this helps π
Your solution is awesome π
Happy coding broβοΈ
Marked as helpful
@zainy2401
Posted
@rayaatta I really appreciate your comments its going to helping me become a better coder! I'm going to make these changes and remember your comments in the future, Thanks!