如何从元素的底部到顶部更改滚动条位置? [英] How to change scrollbar position from bottom to top of the element?

查看:96
本文介绍了如何从元素的底部到顶部更改滚动条位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用css从元素的底部到顶部更改滚动条位置?

Is it possible to change scrollbar position from bottom to top of the element with css?

我该怎么做?

codepen.io/anon/pen/xacvC

codepen.io/anon/pen/xacvC

我想要在元素顶部有滚动条。

I want have scrollbar at top of the element.

推荐答案

好的,我想出了这个。根据您的需要进行修改,但这就是您所需要的,您只需要CSS,而不需要JS。这不会改变滚动条,它会将它翻转到顶部而不是底部。如果你想更改滚动条,那么你需要一个插件(JS插件)。

Ok, I've come up with this. Modify it to your needs, but this is all you need, you only need CSS, no 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).

<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>

这篇关于如何从元素的底部到顶部更改滚动条位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆