How to center a div inside layout

Hey! I’m learning vaadin flow from few days and I’m having problem with center a text inside div that under horizontal layout. My structure looks like on the screen shot. I’m not sure why these divs dateNumber and dateName are not in the middle of div. My component class Calendar extends HorizontalLayoutI so tried to setAlignItems(Alignment.CENTER) or even setVerticalComponentAlignment(Alignment.CENTER, dateName, dateNumber) but no result. What I’m doing wrong? Thanks in advance!
image.png

your parent div with the id “day” is no flex layout and therefore your nested styling can’t work.

wow, will check that thanks

ok I did it this way, now looks good :wink: I wrapped these divs (dateNumber, dateName) inside vertical layout with center alignment :slightly_smiling_face:
image.png