DEV Community


Center elements in CSS like a boss

Mangabo Kolawole
FullStack Engineer at Quatrobj | Technical Writer
・1 min read

I found that a lot of devs are confused when it comes to center element in CSS. 👀
Here is the trick I always use when starting a web development project.
Alt Text
Here is the gist link :
And you? How do you proceed? Please feel free to comment.👇

Discussion (1)

mrtoxas profile image

I think it's redundant, why multiply entities? It is enough to know a few basic rules. There are several ways to align and it is not always possible (conveniently) to do this using flex