Centering a variable-width grid after resizing the page
问题 Here is an image of what I want to do in CSS: image. Any ideas? 回答1: Initial issue Centering an element that has no explicit width This prevents the usual solution of margin: 0 auto; from being an option. Greater issue There's no unused space for centering the wrapper in its container An element is said to be shrink-wrapped if its width is determined by the width of its content. If the content changes in size, the width of the element changes likewise. This is the default behavior for