My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Kajal Jaiswal

42 likes

·

342 reads

6 comments

Prantik Kumar Seal
Prantik Kumar Seal
Feb 9, 2023

Awesome blog kajal!

1
·
·1 reply
Kajal Jaiswal
Kajal Jaiswal
Author
·Feb 9, 2023

Thanks

·
Akanni Emmanuel
Akanni Emmanuel
Feb 9, 2023

Awesome article.

1
·
Andrew Savetchuk
Andrew Savetchuk
Feb 9, 2023

Good article! It is also possible to center the div using CSS grid like so:

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  display: grid;
  justify-content: center;
  align-items: center;
}

div {
  background: lightgreen;
  height: auto;
}
1
·
·1 reply
Kajal Jaiswal
Kajal Jaiswal
Author
·Feb 10, 2023

Hey thanks for your input.. I actually didn't add grids because I feel it's a really great topic and I should write another blog specifically for grids. In this blog i only mentioned 3 easy ways to center elements, i know there are many more but these are like easiest tricks.

·
Srikar Mk
Srikar Mk
Feb 15, 2023

Pretty nice. Congrats on finally posting your first blog 🫡.

1
·