Bootstrap Navbar固定顶部覆盖正文

时间:2018-08-20 14:46:37

标签: css html5 bootstrap-4

我是php和bootstrap的新手,我正在尝试创建门户网站管理员。我已经使用引导程序示例创建了我的第一页,但是我不知道为页面创建“开始”点不会被导航栏覆盖,而且我也无法更改“欢迎”文字的颜色如果我使用文字class="text-white"

我的代码:

<?php
session_start();
include_once("security.php");
include_once("connectionDB.php");
?>
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="icon" href="img/favicon.ico" type="image/x-icon">

    <title>Menu</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/signin.css" rel="stylesheet">
  </head>

  <body>

    <?php

        $SQLQuery = "SELECT id,filename,starttime,endtime,fromnumber,tonumber FROM gravacao ORDER BY starttime DESC";

        $QueryResult = mysqli_query($conn, $SQLQuery);      
    ?>

            <nav class="navbar navbar-expand-md navbar-dark bg-primary fixed-top">
                  <a class="navbar-brand" href="#">Home</a>
                  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>

                  <div class="collapse navbar-collapse" id="navbarsExampleDefault">
                    <ul class="navbar-nav mr-auto">
                            <li class="nav-item dropdown">
                                <a class="nav-link text-white" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Configuration</a>
                                <div class="dropdown-menu" aria-labelledby="dropdown01">
                                  <a class="dropdown-item" href="#">Users</a>
                                  <a class="dropdown-item" href="#">List</a>
                                </div>
                            </li> 
                                <li class="nav-item dropdown">
                                <a class="nav-link text-white" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Reports</a>
                                <div class="dropdown-menu" aria-labelledby="dropdown01">
                                  <a class="dropdown-item" href="list.php">List</a>
                                </div>
                            </li>  
                    </ul
                  <a class="text-white">Welcome <?php echo $_SESSION['Name']; ?></a>&nbsp&nbsp;

                  <form class="form-inline my-2 my-lg-0" action="sair.php">       
                      <button class="btn btn-outline-light my-2 my-sm-0" type="submit">Logout</button>
                    </form>
                  </div>
            </nav>

     <main role="main" class="container">
          <div class="starter-template">
                <h2>Start Table Text</h2></br>
            <div class="table-responsive">
                  <table class="table">
                     <thead>
                          <tr>
                            <th>Start</th>
                            <th>End</th>

                          </tr>
                        </thead>
                      <tbody>
                        <?php
                            while($rows = mysqli_fetch_array($QueryResult))
                            {
                                echo "<tr>";
                                echo "<td>".date("d-m-Y H:i:s",strtotime($rows['starttime']))."</td>";
                                echo "<td>".date("d-m-Y H:i:s",strtotime($rows['endtime']))."</td>";
                                echo "</tr>";
                            }
                        ?>
                      </tbody>
                    </table>
    </main><!-- /.container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/jquery-3.3.1.slim.min.js"></script>
    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery-slim.min.js"><\/script>')</script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

enter image description here

我该如何解决?非常感谢你!

0 个答案:

没有答案