@huyphan2210
Posted
Hi, @otimdan,
I took a look at your solution and wanted to share some thoughts:
- Your
.card
isn’t centered on the page because thebody
doesn’t fill the entire viewport. The viewport is the visible area of the web page. To ensure thebody
occupies the full height of the viewport, you should applymin-height: 100vh
to thebody
. This is a good practice because it guarantees that your layout will be responsive and adapt well to different screen sizes. You can also make thebody
a flexbox to center your.container
like this:
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
- Additionally, consider using semantic HTML elements instead of relying solely on
<div>
. Semantic elements, like<header>
,<footer>
, and<main>
, provide meaning to the structure of your document and improve accessibility, making it easier for both developers and search engines to understand the content.
Let me know if you have any questions! Hope this helps!
Marked as helpful
@otimdan
Posted
@huyphan2210 Thank you for the feedback, I'll edit my code and read more on viewports and better HTML semantic elements.