第一个问题,宽度并不是无限大,是被这个 swiper 组件计算并指定的。看起来很大应该是这个组件的计算 bug 。
第二个问题,因为标准就这么定义的
CSS spec: https://www.w3.org/TR/css-overflow-3/
The visible/clip values of overflow compute to auto/hidden (respectively) if one of overflow-x or overflow-y is neither visible nor clip.
MDN 解读: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x
If overflow-y is hidden, scroll, or auto, and the overflow-x property is visible (default), the value will be implicitly computed as auto.