@ShamSuther
Posted
Hey there! Congratulations on completing this challenge! ✨🎉
Your solution looks wonderful! 👍 You're curious about the best way to center a div? No problem at all, I'm here to help! In fact, there are a couple of ways that you might find really handy, and one of them involves using Flexbox =>
height: 100vh;
display: flex;
align-items: center; /* for vertical centering */
justify-content: center; /* for horizontal centering */
and the second one would be using a display grid property =>
height: 100vh;
display: grid;
place-content: center; /* both horizontal & vertical centering */
to make sure both methods work, you'll need to set a specific height for the container or body. By compressing the text, if you mean to center it!? you could try putting all the text inside a div and then applying flex property to it.
For a better understanding of these topics, I found these blogs very helpful
- A Complete Guide to Flexbox
- A Complete Guide to CSS Grid
- Centering in CSS: A Complete Guide
- Fun with Viewport Units
I hope you find this somewhat helpful, Keep up the fantastic work, and remember there's no rush. Enjoy the process! 😊💻✨
Marked as helpful