DEV Community

Discussion on: Do you still use "position" to center align vertically and horizontally?

Collapse
 
kylefilegriffin profile image
Kyle Griffin

It depends on

  • How many items horizontally need to be aligned
  • If i want the content to center while ignoring other elements in the container
  • If I want the content to take the container width into account.
  • If I expect the number of elements to change.
  • If I want the padding to be factored into the alignment of the items.
Collapse
 
titungdup profile image
dhondup

Nice scenarios! Can you also specify solution method you use in each case? That would be great to know.