如何禁用index.html中的滚动而不是其他页面

我想禁用我的index.html中的滚动选项而不是其他页面。

我试图隐藏它,但那不是我想要的。

我有这在我的CSS,但它只隐藏滚动条:

body {background: rgba(169,3,41,1); background: -moz-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%); background: -webkit-gradient(left top, right top, color-stop(0%, rgba(169,3,41,1)), color-stop(44%, rgba(143,2,34,1)), color-stop(100%, rgba(109,0,25,1))); background: -webkit-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%); background: -o-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%); background: -ms-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%); background: linear-gradient(to right, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a90329', endColorstr='#6d0019', GradientType=1 ); **overflow: hidden** }

我也试着这样做:

body {background: rgba(169,3,41,1);

背景:-moz-linear-gradient(左,rgba(169,3,41,1)0%,rgba(143,2,34,1)44%,rgba(109,0,25,1)100%) ; 背景:-webkit-gradient(左上,右上,颜色停止(0%,rgba(169,3,41,1)),停止颜色(44%,rgba(143,2,34,1)) ,颜色停止(100%,rgba(109,0,25,1))); 背景:-webkit-linear-gradient(左,rgba(169,3,41,1)0%,rgba(143,2,34,1)44%,rgba(109,0,25,1)100%) ; 背景:-o-linear-gradient(左,rgba(169,3,41,1)0%,rgba(143,2,34,1)44%,rgba(109,0,25,1)100%) ; 背景:-ms-linear-gradient(左,rgba(169,3,41,1)0%,rgba(143,2,34,1)44%,rgba(109,0,25,1)100%) ; 背景:线性梯度(右边,rgba(169,3,41,1)0%,rgba(143,2,34,1)44%,rgba(109,0,25,1)100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr ='#a90329',endColorstr ='#6d0019',GradientType = 1); 位置:固定; overflow-y:scroll; 宽度:100%; }

但是,这使我的背景科洛菲消失并适用于我的所有网页...


溢出-γ:隐藏; / *使用它来隐藏垂直滚动* /

溢出 - X:汽车; / *使用此显示水平滚动* /

例如:

html, body {
    overflow-y:hidden;
}

通过CSS3停止滚动的简单方法

    body
    {
        position: fixed; 
        overflow-y: scroll;
        width: 100%;
background: rgba(169,3,41,1);
background: -moz-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(169,3,41,1)), color-stop(44%, rgba(143,2,34,1)), color-stop(100%, rgba(109,0,25,1)));
background: -webkit-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%);
background: -o-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%);
background: -ms-linear-gradient(left, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%);
background: linear-gradient(to right, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a90329', endColorstr='#6d0019', GradientType=1 );
**overflow: hidden**
    }
链接地址: http://www.djcxy.com/p/89335.html

上一篇: how to disable scrolling in index.html not the other pages

下一篇: reflect in firefox and IE