gpt4 book ai didi

html - 使用 Adob​​e Business Catalyst 时的 Bootstrap 导航问题

转载 作者:行者123 更新时间:2023-11-28 06:37:33 24 4
gpt4 key购买 nike

在处理我的作品集时,我发现在将我的 Bootstrap 网站加载到 Adob​​e Business Catalyst 时遇到了一些问题。我已经能够修复大部分错误,除了导航。出于某种原因,在全屏或小屏幕上查看时,我无法使用下拉功能。我的导航当前布局为:

<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<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="home.html"><img src="images/logo.png" alt="logo" class="img-responsive"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul id="customnav">
<li class="active"><a href="home.html">Home</a></li>

<!--Portfolio-->
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="portfolio.html" role="button" aria-haspopup="true" aria-expanded="false"> Portfolio <span class="caret"></span> </a>
<ul class="dropdown-menu">
<li> <a href="about.html"> About </a> </li>
<li> <a href="image.html"> Image </a> </li>
<li> <a href="video.html"> Video </a> </li>
<li> <a href="program.html"> Programming </a> </li>
<li> <a href="sound.html"> Sound </a> </li>
</ul>
</li>
<!--Music-->
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="music.html" role="button" aria-haspopup="true" aria-expanded="false"> Music <span class="caret"></span> </a>
<ul class="dropdown-menu">
<li> <a href="performances.html"> Performances </a> </li>
<li> <a href="songs.html"> Song List </a> </li>
</ul>
</li>

<!--Travel-->
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="travel.html" role="button" aria-haspopup="true" aria-expanded="false"> Travel <span class="caret"></span> </a>
<ul class="dropdown-menu">
<li> <a href="2014.html"> 2014 </a> </li>
<li> <a href="2013.html"> 2013 </a> </li>
<li> <a href="2012.html"> 2012 </a> </li>
<li> <a href="2011.html"> 2011 </a> </li>
<li> <a href="2010.html"> 2010 </a> </li>
</ul>
</li>
</ul>
</div><!--/.navbar-collapse -->
</div>
</nav>

我还有以下用于导航的 CSS:

    /* Nav */
#customnav li{
list-style: none;
font-family: 'Handlee', cursive;
font-size: 22px !important;
font-weight: bold !important;
margin-bottom: 5px;
margin-top: 5px;
color: #BF9FB1 !important;
}

.navbar-inverse {
background-color: #3B3C59 !important;
}

#customnav a:hover, #customnav li a:focus {
background-color: transparent;
color: #F2DFED !important;
border-bottom: 3px solid #F2DFED;
text-decoration: none;
}
#customnav .active > a, #customnav .active a:hover, #customnav .active a:focus {
color: #F2DFED !important;
border-bottom-color: #F2DFED;
text-decoration: none;
}

.dropdown-menu{
background-color: #3B3C59 !important;
display: none !important;
}

.dropdown-menu li a{
display: flex !important;
margin-left: 20px;
color: #BF9FB1 !important;
}

/* Full Screen */
@media (min-width: 768px) {

/*Nav*/
#customnav{
margin-right: 40px !important;
margin-left: 0px !important;
padding-left: 0px !important;
}

#customnav li{
display: inline-block;
font-family: 'Handlee', cursive;
}

#customnav li + li {
margin-left: 20px;
margin-top: 15px;
}
#customnav li a {
padding-right: 0;
padding-left: 0;
font-size: 22px !important;
font-weight: bold !important;
color: #BF9FB1 !important;
border-bottom: 3px solid transparent;
}
#customnav a:hover, #customnav li a:focus {
background-color: transparent;
color: #F2DFED !important;
border-bottom: 3px solid #F2DFED;
text-decoration: none;
}
#customnav .active > a, #customnav .active a:hover, #customnav .active a:focus {
color: #F2DFED !important;
border-bottom-color: #F2DFED;
text-decoration: none;
}

.navbar-inverse {
background-color: #3B3C59 !important;
}

.dropdown-menu{
background-color: #3B3C59 !important;
display: none !important;
}

.dropdown-menu li{
display: flex !important;
margin-left: 20px;
}

.dropdown-menu li a{
font-size: 18px !important;
}

如果有帮助,我的作品集位于:laurenkapraun.com

任何帮助将不胜感激!!非常感谢你!

最佳答案

找到保存导航的主要 ul 并添加以下类:

<ul id="customnav" class="nav navbar-nav">

然后在 CSS 中,删除您为复制上面这些类已经从 Bootstrap 提供的内容所做的所有代码,只保留此 css:

 #customnav li{
list-style: none;
font-family: 'Handlee', cursive;
font-size: 22px !important;
font-weight: bold !important;
margin-bottom: 5px;
margin-top: 5px;
color: #BF9FB1 !important;
}

现在下拉菜单起作用了。您需要做的就是校正颜色和一些小的调整。但是所有的 css 功能都是从框架继承的(你使用 Bootstrap 的主要原因,对吧?):)

查看工作 DEMO

关于html - 使用 Adob​​e Business Catalyst 时的 Bootstrap 导航问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34540707/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com