Inline-block vertical align

Hey @walfrido77

You could do this again only in Webflow without custom code.
(custom code is not in a separate css file but in the header or footer as a style tag (which is not the cleanest way to my opinion)

Regarding the way I mentioned before I will go like this :

1 - create a div and give it a class of center-align-parent (or what ever make sens to you) and set it to relative
2 - create 2 div inside the centering-parent div and give them a class of horizontal-align and vertical-align respectively
3 - set horizontal-align with absolut - left 50% and transform x - 50%
4 - set vertical-align with absolut - top 50% and transform y - 50%

Now you can delete all of them the classes are in your styles

That way when you want to center you can add the combo classes to what you want
So if you want something vertically and horizontally in the middle.

1 - add combo class center-align-parent to parent
2 - add combo classes horizontal-align and vertical-align to child which you want centered.

Hope it makes sens.

Max

1 Like