---
title: "Discussion on \"The easiest way to center a DIV with Vanilla CSS & Tailwind CSS\" | Hashnode"
description: "Discussion on \"The easiest way to center a DIV with Vanilla CSS & Tailwind CSS\". Hello folks, one of the most common questions related to web development that is asked on Google is How to center a div?\n\nAnd today, I will answer that question with just a single line of code. \nSo, how to center a div?\nHere, I will discuss two diffe..."
url: "https://hashnode.com/posts/the-easiest-way-to-center-a-div-with-vanilla-css-tailwind-css/62e1020a657a4fae5a0e6b90"
---

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

Discussion

# [The easiest way to center a DIV with Vanilla CSS & Tailwind CSS](https://codewithsnowbit.hashnode.dev/the-easiest-way-to-center-a-div-with-vanilla-css-tailwind-css?utm_source=hashnode&utm_medium=feed)

Hello folks, one of the most common questions related to web development that is asked on Google is How to center a div? And today, I will answer that question with just a single line of code. So, how to center a div? Here, I will discuss two diffe...

Jul 27, 2022 · 1 min read · codewithsnowbit.hashnode.dev  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#tailwind-css](https://hashnode.com/tag/tailwind-css)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Dhairya Shah](https://hashnode.com/@codewithsnowbit)

@codewithsnowbit

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

Frontend Web Developer | Technical Writer

I am 17 years old and a young passionate and self-taught frontend web developer and have an intention to become a successful developer. I usually write about JavaScript and Web Development and share some tips in the articles.

## Responses 1

Markdown supported · ⌘↵ to post

[David](https://hashnode.com/@dave0)

[Jul 27, 2022](https://hashnode.com/posts/the-easiest-way-to-center-a-div-with-vanilla-css-tailwind-css/62e1020a657a4fae5a0e6b90/comment/62e13aca657a4fae5a0e7809)

cool article

[Dhairya Shah](https://hashnode.com/@codewithsnowbit)

[Jul 27, 2022](https://hashnode.com/posts/the-easiest-way-to-center-a-div-with-vanilla-css-tailwind-css/62e1020a657a4fae5a0e6b90/comment/62e13aca657a4fae5a0e7809#reply-62e161b8d15a9fb24e514246)

Thank you 😊
