小编Ren*_*aud的帖子

缩放子级上的溢出滚动:X和Y轴上的不同行为

这是一个显示我的问题的代码

.container {
  width: 200px;
  height: 200px;
  overflow: auto;
}

.child {
  width: 400px;
  height: 400px;
  /* When scaling down, no more X scrolling because size is 200px, but still Y scrolling :( */
  transform: scale(0.5);
  /* Both axis working the same (no more scrolling) when absolutely positioned */
  /* position: absolute; */
}

/* Irrelevant styling */
.container {
  border: 2px solid palevioletred;
  position: relative;
}

.child {
  background-color: pink;
  transform-origin: top left;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
  <div class="child">
    Child …
Run Code Online (Sandbox Code Playgroud)

html css scrollbar css3

6
推荐指数
1
解决办法
213
查看次数

标签 统计

css ×1

css3 ×1

html ×1

scrollbar ×1