DEV Community

Discussion on: 3 ways to centre a div + life advice

Collapse
 
afif profile image
Temani Afif

don't use the flexbox method that way: dev.to/afif/never-make-your-text-c...

Collapse
 
inurfacejerks profile image
Mike

This conversation was somewhat insightful! I'm gonna read it again

Collapse
 
tilkinsc profile image
Cody Tilkins

For those who are wondering,

.flex_center {
    display: flex;
    justify-content: center;
    align-items: center;
}

<section class="flex_center">
    <div>
        test
    </div>
    <div>
        test2
    </div>
</section>
Enter fullscreen mode Exit fullscreen mode
Collapse
 
code_rabbi profile image
Emeka Orji

This is very true! I read the post.
But I still think; since you pointed out a problem in that post, you should have 'made available' a solution. Either by you or redirecting to a post that solves the problem

Collapse
 
afif profile image
Temani Afif

I already gave the solution "don't make text container flexbox container". I am not solving a problem, I am warning people about the wrong use of flexbox. If they don't do it, they will not have a problem

When your eyes are hurting because you are staying too long in front of a TV, a doctor will tell to stop watching TV for too long. He will not tell you "drink this and you can stay the whole day in front of the TV"