Note: I am implementing Flexbox in my design
When resizing the screen, I utilize "display:none" to eliminate some elements that won't fit as the layout adjusts. However, once these elements are removed, the remaining ones aren't horizontally centered within their columns anymore.
For instance (this is an illustration and not actual code):
|-------------------------------|
| | | | |
| 1 2 | 1 2 | 1 2 | 1 2 |
|-------|-------|-------|-------|
After the "2" element is hidden with "display:none", the remaining elements lose their horizontal centering:
|-------------------------------|
| | | | |
| 1 | 1 | 1 | 1 |
|-------|-------|-------|-------|
I am looking for the optimal method to maintain horizontal centering while scaling down and removing the "2" element. Any suggestions?