DEV Community

Discussion on: 3 Ways to CENTER a div in CSS

Collapse
lassev profile image
lasse

Hey thanks for this!

But you can Also just center a div with a text-align: center;

Collapse
unclecheap profile image
UncleCHEAP

Left-to-right center yeah, but that doesn't affect the relation to its parent vertically.

Collapse
codeoz profile image
CodeOz Author

Totally agree!