简体   繁体   English

如何将滚动条的位置从元素的底部更改为顶部?

[英]How to change scrollbar position from bottom to top of the element?

Is it possible to change scrollbar position from bottom to top of the element with css? 可以使用CSS将滚动条的位置从元素的底部更改为顶部吗?

How I can do it? 我该怎么办?

codepen.io/anon/pen/xacvC codepen.io/anon/pen/xacvC

I want have scrollbar at top of the element. 我想要在元素顶部有滚动条。

Ok, I've come up with this. 好的,我想出了这个。 Modify it to your needs, but this is all you need, you only need CSS, no JS. 根据您的需要进行修改,但这就是您所需要的,只需要CSS,不需要JS。 THIS DOES NOT CHANGE THE SCROLLBAR, it flips it to be at the top, instead of the bottom. 这不会更改滚动条,而是将其翻转到顶部而不是底部。 If you want to change the scrollbar, then you will need a plugin (JS plugin). 如果要更改滚动条,则需要一个插件(JS插件)。

<html>
    <head>
        <title></title>
        <style>
            .Container
            {
                width: 200px;
                overflow-y: auto;
            }

            .Content { width: 300px; }

            .Container, .Content
            {
                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 */
            }
        </style>
    </head>
    <body>
        <div class="Container">
            <div class="Content">
                Content Content Content Content Content Content Content Content Content Content Content Content Content Content 
            </div>
        </div>
    </body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM