Start div scrollbar from bottom with pure css

蹲街弑〆低调 提交于 2019-12-30 12:01:51

问题


Is it possible to start a div's scrollbar from bottom (As initial position, not always) instead from top, with pure css?


回答1:


Use transform:rotateX to wrap div and return it (to avoid the text from turning over) also in sub div

.page{
 overflow-y: scroll;

 width:150px;
 height:150px;
 transform:rotateX(180deg);
                -moz-transform:rotateX(180deg); /* Mozilla */
                -webkit-transform:rotateX(180deg); /* Safari and Chrome */
                -ms-transform:rotateX(180deg); /* IE 9+ */
                -o-transform:rotateX(180deg); /* Opera */
}
.sub{
   transform:rotateX(180deg);
                -moz-transform:rotateX(180deg); /* Mozilla */
                -webkit-transform:rotateX(180deg); /* Safari and Chrome */
                -ms-transform:rotateX(180deg); /* IE 9+ */
                -o-transform:rotateX(180deg); /* Opera */
}
    <div class="page">
    <div class="sub">
       <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p> 
    </div>

    </div>


来源:https://stackoverflow.com/questions/52312014/start-div-scrollbar-from-bottom-with-pure-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!