簡體   English   中英

垂直滾動條出現在引導導航,輪播和頁腳中

[英]Vertical scrollbar appearing in bootstrap navigation, carousel & footer

我使用Twitter Bootstrap創建了一個簡單的4頁站點。 盡管以前可以使用,但現在滾動條顯示在主頁上的不同部分。

我在頂部菜單上有一個下拉菜單。 只要單擊“產品”菜單項( https://gyazo.com/8edfee3de1f27861dee5488da2b2a168 ),它就會顯示帶有滾動條的菜單,而不是顯示下拉菜單。

同樣,我還在導航下方創建了一個輪播,但滾動條顯示在“上一個”和“下一個”按鈕上

滾動條甚至出現在頁腳上

在移動設備(仿真器)上查看時,未顯示圖標欄。 https://gyazo.com/7f78dfc4797a135cc3083fa1f6aa8bc2

這是索引頁面的代碼:

    <?php require_once "inc/functions.php"; ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
            <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Simex</title>
        <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="css/main.css" />
    </head>
    <body>
        <?php require "inc/navigationTop.php" ?>

        <?php require "inc/slider.php"; ?>

        <?php require "inc/homeTiles.php" ?>

        <?php require "inc/footer.php" ?>
    </body>
</html>

這是導航部分的代碼:

<?php require_once "inc/functions.php" ?>
<nav class="navbar navTop">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#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="index.php" target="_self">Simex</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="navbar-collapse-1">
      <ul class="nav navbar-nav pull-right navigationList">
        <li><a href="index.php">Home</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Products <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="osmosis.php">Reverse Osmosis</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="waterTreat.php">Water Treatment</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="waterBottling.php">Water Bottling Plant</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="vehicles.php">Japanese Reconditional Vehicles</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="seeds.php">Export &amp; Sesame Seeds</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="agri.php">Agri Farming &amp; Equipment</a></li>
          </ul>
        </li>
        <li><a href="aboutUs.php">About Us</a></li>
        <li><a href="contactUs.php">Contact Us</a></li>
      </ul>
     </div><!-- /.navbar-collapse -->
  </div><!-- /.container -->
</nav>

問題出在附帶的樣式表上。

以前的CSS樣式:

* {
.
.
overflow-x:hidden;
}

我刪除了overflow-x屬性,並將其作為正文的屬性放置,例如:

body {
.
.
.
overflow-x:hidden;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM