Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to horizantally centre items? #57

Open
SanjayBikhchandani opened this issue Jul 1, 2021 · 4 comments
Open

How to horizantally centre items? #57

SanjayBikhchandani opened this issue Jul 1, 2021 · 4 comments

Comments

@SanjayBikhchandani
Copy link

I want the items inside the MuuriComponent to be horizontally centre:
check out this demo: https://codesandbox.io/s/muuri-react-media-query-forked-f1p92?file=/package.json

I want the items in the 2nd row to be horizontally centre, I've tried modifying CSS for MuuriComponent but it didn't worked for me.
Screenshot 2021-07-01 170203

@grzegorzwozny
Copy link

grzegorzwozny commented Jul 2, 2021

Good question. I have the same issue.

@SanjayBikhchandani
Copy link
Author

@kefirr Let me know if you found any solution for this

@grzegorzwozny
Copy link

grzegorzwozny commented Jul 5, 2021

In my case helped: .item { width: 25%; height: 400px; position: absolute; padding: 10px; }

but the better way is to use dedicated utility getResponsiveStyle

dashboard

@SanjayBikhchandani
Copy link
Author

@kefirr I think in your case number of item is fixed, but in my web app, the items keeps changing dynamically upto 25 items.
So if there's an odd number of items then I want it to be horizontally center.

Will it be good to use utility getResponsiveStyle in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants