Horizontally center last items in grid-system by using TailwindCSS utilities #18411
                  
                    
                      rozsazoltan
                    
                  
                
                  started this conversation in
                Show and tell
              
            Replies: 1 comment
-
| Does anyone have better ideas for naming? My brain feels pretty mushy right now. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is not achievable with CSS alone. It's a characteristic of the grid display. You can solve it using flex, and by adjusting the width of the child elements, you can ensure you always have 4 columns.
This could be improved using CSS variables, since the number of gaps depends on the number of items in a row, and is always one less than that.
Beta Was this translation helpful? Give feedback.
All reactions