跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 哪位前端老哥能解释一下,为什么容器设置 overflow-y 也能防止元素*宽度*溢出容器?

发表于

设计的布局很简单:左侧 nav ,右侧 main ; mian 容器中放一个 swiper 轮播组件,宽度默认充满容器。但是

[ codesandbox ] https://codesandbox.io/p/devbox/gzlqqh

  • 为什么 swiper 在未设置宽度情况下,宽度无限大并超出容器? Swiper 宽度溢出 main 容器
  • 为什么容器设置 overflow-y 也能防止元素宽度溢出容器? Swiper 宽度充满容器

初学 CSS 的时候就听说设置 overflow 能治一些疑难杂症,问题是解决了,但想不通是怎么解决的,哪位有经验的前端老哥能解释一下?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.