---
title: "Discussion on \"Different ways to center a div\" | Hashnode"
description: "Discussion on \"Different ways to center a div\". This article tells us how to center a div using flex box, grid and position. This tutorial will help you learn different ways to center a div."
url: "https://hashnode.com/posts/different-ways-to-center-a-div/65ad7ed72562a8dde52e5a5a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Different ways to center a div](https://zaidhassan.hashnode.dev/different-ways-to-center-a-div?utm_source=hashnode&utm_medium=feed)

This article tells us how to center a div using flex box, grid and position. This tutorial will help you learn different ways to center a div.

Jan 21, 2024 · 2 min read · zaidhassan.hashnode.dev  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#center-a-div](https://hashnode.com/tag/center-a-div)
-   [#howtos](https://hashnode.com/tag/howtos)

## Written by

[Zaid Hassan](https://hashnode.com/@zaidhassan)

@zaidhassan · India

  
[View profile](https://hashnode.com/@zaidhassan)

A computer enthusiast, exploring open source, linux, web development and more.

I am a computer nerd who loves to geek out. let's learn things together #learninpublic

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
