---
title: "Discussion on \"3 ways to center a div in css\" | Hashnode"
description: "Discussion on \"3 ways to center a div in css\". In this article, I will tell you the ways I have used to center a div. Using CSS, you can center text in a div in multiple ways. Here we will learn the 3 ways to center a div. The first is by using position property, the second by using flex, and the..."
url: "https://hashnode.com/posts/3-ways-to-center-a-div-in-css/6306316fd69cbd5671587cb4"
---

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

Discussion

# [3 ways to center a div in css](https://lalitha.hashnode.dev/3-ways-to-center-a-div-in-css?utm_source=hashnode&utm_medium=feed)

In this article, I will tell you the ways I have used to center a div. Using CSS, you can center text in a div in multiple ways. Here we will learn the 3 ways to center a div. The first is by using position property, the second by using flex, and the...

Aug 24, 2022 · 3 min read · lalitha.hashnode.dev  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#developer](https://hashnode.com/tag/developer)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Lalitha](https://hashnode.com/@lalithaV)

@lalithaV · Andhra Pradesh

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

LalithaV

Engineer,Javascript ,ReactJs

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
