【发布时间】:2021-02-04 07:34:56
【问题描述】:
我在 html/CSS 方面完全是新手,试图为应用程序制作一个简单的网页。有人可以告诉我为什么页面无法显示汉堡包图标。我认为它应该在品牌和开始文本之间显示为白色。这是使用以下脚本实际显示的屏幕截图。 截图:
/* Modify the background color */
.navbar-custom {
background-color: #004d99;
}
/* change the brand and text color */
.navbar-custom .navbar-brand,
.navbar-custom .navbar-text {
color: white;
}
/* change the link color */
.navbar-custom .navbar-nav .nav-link {
color: white;
}
/* change the color of active or hovered links */
.navbar-custom .nav-item.active .nav-link,
.navbar-custom .nav-item:hover .nav-link {
color: white;
}
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
</head>
<nav class="navbar navbar-custom">
<div>
<a class="navbar-brand" href="/"><strong>The Brand</strong></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation" style="color: white">
<span class="navbar-toggler-icon" style="color: white"></span><small><strong> START</strong></small>
</button>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
任何帮助表示赞赏。
【问题讨论】:
-
toggler 没有附加图标。您在跨度中的班级只是说有一个班级,但是当您签入开发工具时,您可以看到之前或之后没有图标。您可能需要自己添加一个图标。
-
注意这种感觉就像你想要一个汉堡包/手风琴组合?
-
stackoverflow.com/q/26317679/125981 在这里可能对您有所帮助,但不是 100% 它是重复的
标签: html css bootstrap-4 navbar