@danielmrz-dev
Posted
Hello @Patrickodida!
Your project looks great!
I have a couple of suggestions for you to improve it even more:
- Using
margin
is not the best option to center an element. Here's a very efficient (and better) way to place an element in the middle of the page both vertically and horizontally:
š Apply this to the body (in order to work properly, don't use position or margins):
body {
min-height: 100vh;
display: flex; /* it works with grid too */
justify-content: center;
align-items: center;
}
š Also, in order to make your HTML code more semantic, don't skip heading levels - start with <h1>
, then use <h2>
, and so on.
Unlike what most people think, it's not just about the size and weight of the text.
- 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/title for the whole page.
All these tag changes may have little or any visual impact but they make your HTML code more semantic and improve SEO optimization as well as the accessibility of your project.
I hope it helps!
Other than that, great job!
Marked as helpful
@Patrickodida
Posted
Hello @danielmrz-dev!
Thank you for this advice.
I have actually used this particular approach you have cited when displaying HTML elements side by side, but not for this kind of project.
This morning, I gave it a shot, and it actually works perfectly.
I have also had issues choosing the right tags to use in my HTML, but thank you for the clarifications.