最佳答案
有一个 hack 使用 transform: scaleY(-1)
从底部开始添加元素
transform: scaleY(-1)
在容器上垂直反转transform: scaleY(-1)
对容器的 child 纠正对 child 的反转。容器的溢出也是从底部开始的!
请看下面的演示:
body {
margin: 0;
}
* {
box-sizing: border-box;
}
.wrapper {
border: 1px solid red;
height: 100vh;
overflow-y: auto;
transform: scaleY(-1);
}
.wrapper > div {
height: 100px;
width: 50vh;
border: 1px solid;
margin: 10px auto;
transform: scaleY(-1);
/*align text inside*/
display: flex;
justify-content: center;
align-items: center;
}
<div class="wrapper">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</div>
让我知道您对此的反馈。谢谢!
关于html - 如何向下添加元素以便能够滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40143821/