When your image gallery's parent div appears too wide in Safari but not in Chrome, it's typically due to differences in how Safari handles flexbox, overflow, or intrinsic sizing.
overflow: auto and overflow: hidden differently, especially with flexbox children that have large intrinsic sizes.overflow to hidden if it's currently on visible or auto.
flex-wrap is set to wrap.flex-wrap: nowrap can force a single line layout, causing unwanted horizontal expansion if child elements exceed the width.min-width or max-width, as improper settings can break the layout consistency in Safari.
max-width: 100% style and no fixed width that exceeds the container.display: inline, which can cause layout shifts or extra spacing in Safari.
gap spacing differently, especially on flex or grid containers.
<script> or inline CSS), ensure none of it injects styles like min-width or adds padding that only affect Safari.
The most likely cause is a flexbox or image sizing difference in Safari. Use overflow: hidden, ensure proper max-width settings on images, and confirm flex-wrap: wrap is enabled. Inspect for spacing issues or custom code that may behave inconsistently in Safari.