Here are a few suggestions for improvement:
- Use
display: flex
on the body to center your container both horizontally and vertically. Also, settingmin-height: 100vh
ensures that the body takes up at least the full height of the viewport, making sure your content is always centered regardless of the viewport height.
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
- In general, it’s better to use class names rather than tags as selectors.
- It’s also a good practice to style everything for mobile view first, use media queries with min-width, and then adjust the styles for larger screens.
Marked as helpful
0