@Sdann26
Posted
Hi Kingsley!
If you want to vertically center your columns you could add to the body.
body {
font-size: 0.9375rem;
font-family: "Big Shoulders Display", sans-serif;
font-weight: 700;
background-color: #f2f2f2f2;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
These last 5 attributes generate the vertical centering :D apart we put a minimum height so that it gets bigger when it goes to mobile size.
Finally change all those h1 to h2, you shouldn't have more than one per page.
What will cause the doubt, then what do I do so that I don't get the frontend mentor error for not having an h1.
I could recommend you this sacred technique which is to add a h1 inside your <main> and give it the class sr-only which is so that the screen reader detects it but it does not appear in your flow and at the end you just add the following attributes:
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0,0);
border: 0;
}
And with just this ready you should no longer have any accessibility errors.
If you have any questions you can ask :D!
Marked as helpful