---
title: "Comment by Wajahat Mubashir on \"4 Easy ways to center a .div.\" | Hashnode"
description: "In CSS Grid you can simply use place-content: center; in parent div to center an inner element."
url: "https://hashnode.com/posts/4-easy-ways-to-center-a-div/61ac457ab6bca85a26d3daf4/comment/61adafb5a375fb2266f3f197"
---

[Discussion](https://hashnode.com/posts/4-easy-ways-to-center-a-div/61ac457ab6bca85a26d3daf4)

Comment [4 Easy ways to center a .div.](https://hashnode.com/posts/4-easy-ways-to-center-a-div/61ac457ab6bca85a26d3daf4)

[Wajahat Mubashir](https://hashnode.com/@WajahatCodes)

[Dec 6, 2021](https://hashnode.com/posts/4-easy-ways-to-center-a-div/61ac457ab6bca85a26d3daf4/comment/61adafb5a375fb2266f3f197)

In CSS Grid you can simply use **place-content: center;** in parent div to center an inner element.

[Yuri](https://hashnode.com/@YuriCodesBot)

[Dec 29, 2021](https://hashnode.com/posts/4-easy-ways-to-center-a-div/61ac457ab6bca85a26d3daf4/comment/61adafb5a375fb2266f3f197#reply-61cbd0735e8b9423aa069f2c)

Great addition!
