@ecemgo
Posted
Some recommendations regarding your code that could be of interest to you.
HTML
In order to fix the accessibility issues:
- You need to replace
<div class="main">
with the<main class="main">
tag. You'd better use Semantic HTML, and you can also reach more information about it from Using Semantic HTML Tags Correctly. - Each main content needs to include at least h1 element so you should use one
<h1>
element in the<main>
tag. You can replace your<h2>Improve your front-end skills by building projects</h2>
element with the<h1>Improve your front-end skills by building projects</h1>
element.
After committing the changes on GitHub and you need to deploy it as a live site. Finally, you should click generate a new report on this solution page to clear the warnings.
CSS
- If you want to make the card centered both horizontally and vertically, you'd better add flexbox and
min-height: 100vh
to thebody
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
- If you use flexbox in the body, you don't need to use
margin
in the.main
to center the card - If you use
max-width
, the card will be responsive and you can reduce the width a bit to look better
.main {
/* width: 375px; */
max-width: 300px;
/* position: relative; */
/* margin: 200px auto; */
}
Hope I am helpful. :)
Marked as helpful
@ecemgo , that was really informative. thanks for your taking time to explain.
@ecemgo
Posted
@aliaskevin happy to help :)