HTML – 如何让页面停止垂直滚动?

HTML – 如何让页面停止垂直滚动?,第1张

概述我有一个非常讨厌的问题.我试图创建一个具有完整背景图像的页面,该页面调整大小并填充浏览器屏幕.目前它的一半工作但由于某种原因必须滚动20-30px下来.哪个用户不应该这样做. 这是页面源: <!DOCTYPE html><html><head> <title></title> <link href="/Content/css/reset.css" rel="stylesheet 我有一个非常讨厌的问题.我试图创建一个具有完整背景图像的页面,该页面调整大小并填充浏览器屏幕.目前它的一半工作但由于某种原因必须滚动20-30px下来.哪个用户不应该这样做.

这是页面源:

<!DOCTYPE HTML><HTML><head>    <Title></Title>    <link href="/Content/CSS/reset.CSS" rel="stylesheet" type="text/CSS" />    <link href="/Content/CSS/Site.CSS" rel="stylesheet" type="text/CSS" />    <link href="/Content/CSS/menu.CSS" rel="stylesheet" type="text/CSS" />    <link href="/Content/CSS/layout.CSS" rel="stylesheet" type="text/CSS" />        <link href="/Content/CSS/scroll.CSS" rel="stylesheet" type="text/CSS" />    <script src="/Scripts/jquery-1.6.4.Js" type="text/JavaScript"></script>    <script src="/Scripts/backstretch.Js" type="text/JavaScript"></script>    <script type="text/JavaScript">        /**     var images = [        "/content/images/bghome.jpg","/content/images/background.jpg"        ];              var index = 0;             $.backstretch(images[index],{ speed: 500 });         setInterval(function () {            index = (index >= images.length - 1) ? 0 : index + 1;            $.backstretch(images[index]);        },5000);   **/        $.backstretch("/content/images/background.jpg");    </script></head>           <div ><ul>  <li>    <a href="/Home/Index">home</a>  </li>  <li>    <a href="/content/1/10/background.HTML">profile</a>  </li>  <li>    <a href="/content/1/3/portfolio.HTML">portfolio</a>  </li>  <li>    <a href="/news/">news</a>  </li>  <li>    <a href="/project/">current projects</a>  </li>  <li >    <a href="/content/1/6/awards.HTML">awards</a>  </li>  <li>    <a href="/ContactUs/">contact</a>  </li></ul>      </div>    <div ID="left-sIDebar">        <div ID ="logo">            <image src="/content/images/logo.png"/>        </div>        <div ID = "leftcontent">            <p>            </p>         </div>                     <div ID ="foot"><ul>  <li>    <a href="/content/2/20/privacy.HTML">Privacy</a>  </li>  <li>    <a href="/content/2/21/sitemap.HTML">Sitemap</a>  </li>  <li >    <a href="/content/2/19/terms---conditions.HTML">Terms & Conditions</a>  </li></ul>© 2012 SH Structures. All rights reserved. &nbsp;&nbsp;&nbsp;<image src="/content/images/footimg.png"/>        </div>    </div>            <div ID="right-sIDebar">            </div>            <div ID="content">                <div ID = "freestylecontent">                    <h1>awards</h1>                    <br><br><br>                    <div ID = "freecontent">                        <p>                        </p>                         <br><br>                    </div>                 </div>               </div></HTML>

CSS:

HTML,body {    height: 100%;    wIDth: 100%;    padding: 0px;    margin: 0px;}body {}/* ie7 Fix */* HTML #container {    display: table;    height: 100%}/* Opera Fix */body:before {    content: "";    height: 100%;    float: left;    wIDth: 0;    margin-top: -32767px;}/* ie6 Fix */* HTML div#body {    overflow: visible;}div#container {    height: 100%;    height: auto !important;    background: url("left-sIDebar-back.gif") repeat-y top left;}div#main {    overflow: auto;    padding-bottom: 100px;}div#header {    height: 100px;    background: #ba6f19;    border-bottom: 1px solID #000;    padding: 20px;}div#body {    overflow: hIDden;    height: 100%;}div#content {    margin: 0px 0px 0px 415px;    wIDth: 375px;    padding: 20px;    background:url(../images/greenfade.png);    opacity:0.8;      height:100%;     color:White;}div#left-sIDebar {    wIDth: 375px;    float: left;    height:100%;    padding: 20px;    background:black;    opacity:0.8;      color:White;}div#right-sIDebar {    wIDth: 260px;    float: right;    padding: 20px;}div#footer {    background: #ba6f19;    border-top: 1px solID #000;    position: relative;    height: 100px;    margin-top: -101px;    clear: both;}div#footer p {    padding: 20px;    margin: 0px;}.menu-link{    Font-size:1em;    height:40px;    padding-left:10px;    wIDth:100%;     margin-left:auto;    margin-right:auto;    background:black;}.menu-link a{    padding: 10px 0px 10px 0px;    height:40px;    color:#fff;    text-decoration:none;    float:left;}.menu-link ul {     padding:0px 0px 0px 20px;}.menu-link ul li    {    text-decoration:none;    float:left;    /**background: url(/Content/img/border-line-insIDe.png) no-repeat right;**/}.menu-link ul li a {    color:#fff;    padding: 0px 10px 0px 10px;    line-height:40px;    display: block;     text-align:center;}.menu-link a:hover{    background:url(../images/menu-nav-hov.png) repeat-x;    cursor:pointer; }.menu-link ul li.on {    background:url(../images/menu-nav-hov.png) repeat-x;/** background-position:center bottom;    background-repeat:no-repeat;**/}/** SIDe Menu **/.sIDeMenu ul li.on a{    height:2em;    padding-top: 2px;    background:url(../images/point.png) no-repeat;    Font-weight:bold;   }.sIDeMenu ul{        padding: 15px 0px 0px 0px;      List-style-type:none;    Font-size:0.9em;    wIDth:20em;    color:#fff;       margin-left:-10px;}.sIDeMenu ul a{    padding: 2px 20px 0px 0px;      color:#fff;    text-decoration:none;    float:left;    wIDth:19.2em;}.sIDeMenu li a{    height:2em;    padding-top: 1px;    padding-left:15px;}.sIDeMenu li a:hover{    background:url(../images/point.png) no-repeat;    cursor:pointer;     padding-left:-15px;}.sIDeMenu h4{    display:none;}/** Footer **/#foot{   padding-left: 20px;   padding-right: 20px;   position:absolute;   bottom:0;   height:60px;   height:1.5em;   Font-size:.8em;}#foot li a{    padding: 10px 0px 10px 0px;     color:#fff;    text-decoration:none; }

我错过了一些明显的东西吗谢谢

解决方法 很难确切地说出你在问什么,但如果你想要做的就是禁用滚动页面,你首先需要添加一个< body>标记并为其指定以下样式属性:

<body >    <!-- Page contents --></body>
总结

以上是内存溢出为你收集整理的HTML – 如何让页面停止垂直滚动?全部内容,希望文章能够帮你解决HTML – 如何让页面停止垂直滚动?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1067285.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-26
下一篇2022-05-26

发表评论

登录后才能评论

评论列表(0条)

    保存