Skip to main content
Known Participant
Feb 25, 2023 4:22 AM UTC
Question

Align content with pagination

I try to make 6 items in a row, and divide in pages

 

 

 

However, when i go to the last page,  the remaining items are aligned central

i try to edit in align-content/align-itself in left 

but it doesnt change 

may i know is there any method?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    26 replies

    Nancy OShea
    Community Expert
    Community Expert
    Feb 25, 2023 9:06 PM UTC

    You provided no link and no CSS code, so I'll take a stab in the dark and speculate that this is caused by Flexbox's handling of negative space.  What appears to be aligned-center is actually just wider product containers compensating for empty space across the bottom row.   More details on that below.

    https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Controlling_Ratios_of_Flex_Items_Along_the_Main_Ax

     

    Hope that helps.

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Known Participant
    Apr 12, 2023 8:15 AM UTC

     Yes, i would like to show in this ratio

     

     What ccs should write?

     

    Translate
    Legend
    Apr 12, 2023 11:06 AM UTC

    Looks like you have used flex on the 'buy' div and probably space between or space around for justify content.

     

    Youre better off in this situation using grid, try:

     

    .buy  {

    display: grid;

    grid-template-columns: repeat(6, 1fr);

    grid-gap: 30px;

    }

     

     

    Translate
    Legend
    Feb 25, 2023 9:14 AM UTC

    What css are you using for the 'container' and 'buy' divs?

    Translate