Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【打卡】 #8

Open
swustzzh opened this issue Oct 20, 2023 · 1 comment
Open

【打卡】 #8

swustzzh opened this issue Oct 20, 2023 · 1 comment

Comments

@swustzzh
Copy link
Owner

书名:CSS世界

章节:第六章 流的破坏与保护

思考:

@swustzzh
Copy link
Owner Author

swustzzh commented Oct 20, 2023

一个滚动条出现与否不会导致页面晃动的小技巧:

html {
  overflow-y: scroll; /* for IE8 */
}
:root {
  overflow-y: auto;
  overflow-x: hidden;
}
:root body {
  position: absolute;
}
body {
  width: 100vw;
  overflow: hidden;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant