为什么网页显示水平滚动条,即使它适合屏幕

时间:2017-06-06 18:12:12

标签: html css bootstrap-4

我创建了这个网页,它非常适合浏览器。但是这个水平滚动条可以水平导航。如果网站正确适合屏幕,则不能有水平条。

我检查过我是否通过浏览器意外缩放了网页。我甚至用不同的浏览器检查过。但这一切都显示出相同的......

这是网页的屏幕截图:

enter image description here

这是我的代码示例:

<!DOCTYPE html>
<html>
<head>
    <title>Omicron.com</title>


    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/custom.css">



<style>

/*#MostUpperGreyLine img{
    width: 100%;
    min-width: 10px;
    height:auto;
}*/
#Header-New img{
    width: 100%;
    min-width: 10px;
    height: auto;
    position: relative;
    top:-5px; 
}

</style>

</head>
<body>


    <!--<div id="MostUpperGreyLine">
        <img src="MostUpperGreyLine.png" alt="No Green Header Found!">
    </div>-->

    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="HomePage.html" style="font-family:N-Gage;font-size:15px;">Omicron.Inc</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home<span class="sr-only">(current)</span></a></li>
                    <li><a href="#">About Us</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Our Softwares <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Software 1</a></li>
                            <li><a href="#">Software 2</a></li>
                            <li><a href="#">Software 3</a></li>
                            <!--<li role="separator" class="divider"></li>
                            <li><a href="#">Separated link</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#">One more separated link</a></li>-->
                        </ul>
                    </li>
                </ul>

                <form class="navbar-form navbar-left">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="Search">
                    </div>
                    <button type="submit" class="btn btn-default">Search</button>
                </form>

                <ul class="nav navbar-nav navbar-right">
                    <li><a href="#">Contact Us</a></li>
                    <!--<li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Contact Us <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Facebook</a></li>
                            <li><a href="#">Another action</a></li>
                            <li><a href="#">Something else here</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#">Separated link</a></li>
                        </ul>
                    </li>-->
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>


    <div id="Header-New">
        <img src="Header-New.png" alt="Header not Found!">
    </div>  



<div class="row">
  <div class="col-sm-6 col-md-4">
    <div class="thumbnail">
      <img src="square.png" alt="...">
      <div class="caption">
        <h3 style="font-size:16px;position:relative;left:35px;top:-27px;font-family:Myriad Pro;color:white;">Software Name</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary btn-ok" role="button">Read More</a></p>
      </div>
    </div>
  </div>
</div>



<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

删除.row的margin-left和margin-right,并将其修复。