DEV Community

loading...

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 : https://gist.github.com/Kolawole39/b39693399dd8851a6e9e95c10a61b70a
And you? How do you proceed? Please feel free to comment.👇

Discussion (1)

Collapse
mrtoxas profile image
mrtoxas

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