php - 为什么我的 bootstrap 导航栏在 bootstrap 4 中不显示内联?

标签 php jquery html css bootstrap-4

<分区>

我在 php 中创建了一个单独的头文件,这样我就可以通过 php 包含函数 将其包含在每个页面中来重复使用它> 但在 header page 中,当我编写简单导航栏的代码时,它显示在列表项中而不是内联。

(This question is not exactly same with any other question as marked duplicate by someone, I have gone through different questions to find my issue but I didn't find any so I asked this question by myself)

这是我的代码:

index.php(主索引页)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="img/favicon.ico">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/fontawesome-all.min.css">
</head>
<body>
   <?php include 'header.php'; ?>
   
   <div>
       
   </div>
   
   <?php include 'footer.php'; ?>
   
   <script src="js/jquery-3.3.1.min.js"></script>
   <script src="js/bootstrap.bundle.min.js"></script>
   <script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
</body>
</html>

header.php(我在其中创建引导导航栏的页眉)

<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="index.php">O.S.P</a>
        </div>
        <ul class="nav navbar-nav">
            <li class="active"><a href="index.php">Home</a></li>
            <li><a href="services.php">Services</a></li>
            <li><a href="about-us.php">About Us</a></li>
            <li><a href="sign-in.php">Sign In</a></li>
            <li><a href="sign-up.php">Sign Up</a></li>
        </ul>
    </div>
</nav>

这是 index.css(辅助 CSS 文件)

.nav li{
    display: inline;
}

毕竟,当我运行我的页面时,它显示如下:

我页面的浏览器输出图像:

enter image description here

最佳答案

更新 Bootstrap3 URL 它正在工作

看这个 fiddle

https://jsfiddle.net/xv6mkfo8/3/

关于php - 为什么我的 bootstrap 导航栏在 bootstrap 4 中不显示内联?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49464096/

上一篇:html - 溢出 :hidden dots at the end in 2 line paragraphs

下一篇:html - 为什么背景色填满了整个屏幕?

相关文章:

php - 如何设计一个简单的 Web 应用程序?

javascript - 如何使用 JavaScript 在网络浏览器中打开另一个窗口?

javascript - 在 Vue.js + Laravel 中将 $var 传递到 @{{ }} 中不起作用

php - 如何在php的不同页面中显示数据库中的每一行?

php - Codeigniter 购物车 : Adding the Same Product Again

javascript - 强制浏览器下载一个大的 HTML 文件到磁盘并打开它

javascript - 类型检查 React Children

javascript - 对更新内容的 AJAX 请求进行限速以避免重复

c# - 读取二维码最快的方式 客户端与服务器端

javascript - 在 Opera Mini 中更改占位符