DEV Community

Discussion on: Centering a Div With Tailwind CSS

Collapse
 
afif profile image
Temani Afif

please don't make a text container a flexbox container: dev.to/afif/never-make-your-text-c...

Collapse
 
thomasstep profile image
Thomas Step

Thanks for pointing that out, but that was not the idea or content of this article. Text is easy to see, which is why I used text inside of the div. I did not make any claim about what the content of the div was or should be and I would expect that anyone running into issues with flex content would be looking elsewhere for that information.

Collapse
 
afif profile image
Temani Afif

Text is easy to see, which is why I used text inside of the div --> this is exactly the issue of almost all the centring articles. They all use text so everyone will consider this as a method to center text inside a div and everyone will run into the issues I described in the linked articles because their text won't be I am centred but more than that.

I would expect that anyone running into issues with flex content would be looking elsewhere for that information --> not really or at least it will be a pain to understand "why a code is working fine on the article and not on my website?". This is a big frustration for a beginner that's why I wanted to highlight that issue in case someone is reading this article.