gpt4 book ai didi

html - 导航栏折叠在 Bootstrap 中无法正常工作

转载 作者:太空宇宙 更新时间:2023-11-04 09:18:47 24 4
gpt4 key购买 nike

这是我的 mvc 部分 View :

<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.RouteLink("მთავარი", "AdminControlUsers", null, new { @class = "navbar-brand", @style="padding-left:100px; padding-right:100px"})//this line
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
@if (ViewBag.NavBarActive == "მომხმარებლები")
{
<li class="active">@Html.RouteLink("მომხმარებლები", "AdminControlUsers")</li>
<li>@Html.RouteLink("Stored Procedures", "ControlStoredProcedures", new { page = 1 })</li>
<li>@Html.RouteLink("გაშვებული Stored Procedure-ები", "Admin_User_Results_List")</li>
}
@if (ViewBag.NavBarActive == "Stored Procedures")
{
<li>@Html.RouteLink("მომხმარებლები", "AdminControlUsers")</li>
<li class="active">@Html.RouteLink("Stored Procedures", "ControlStoredProcedures", new { page = 1 })</li>
<li>@Html.RouteLink("გაშვებული Stored Procedure-ები", "Admin_User_Results_List")</li>
}
@if (ViewBag.NavBarActive == "User_Admin Results List")
{
<li>@Html.RouteLink("მომხმარებლები", "AdminControlUsers")</li>
<li>@Html.RouteLink("Stored Procedures", "ControlStoredProcedures", new { page = 1 })</li>
<li class="active">@Html.RouteLink("გაშვებული Stored Procedure-ები", "Admin_User_Results_List")</li>
}
</ul>
<ul class="nav navbar-nav navbar-right">
li><a href='@Url.Action("LogOut", "Administrator")'><span class="glyphicon glyphicon-log-out"></span> გამოსვლა @Session["Admin"].ToString()</a></li>
</ul>
</div>
</div>
</nav>

当我调整浏览器大小时,我的导航栏屏幕截图: enter image description here

enter image description here

enter image description here enter image description here

当我删除其中一行时:

@Html.RouteLink("მთავარი", "AdminControlUsers", null, new { @class = "navbar-brand", @style="padding-left:100px; padding-right:100px"})

如果我删除 @style="padding-left:100px; padding-right:100px"它会正常工作:/。请帮忙

最佳答案

内容比折叠按钮更早溢出,您需要将导航栏折叠按钮设置为更早显示。

您可以通过 CSS 做到这一点,在您的样式表上最后设置它(根据您的需要调整 min-widthmax-width):

@media (min-width: 768px) and (max-width: 991px) {
.navbar-collapse.collapse {
display: none !important;
}
.navbar-collapse.collapse.in {
display: block !important;
}
.navbar-header .collapse, .navbar-toggle {
display:block !important;
}
.navbar-header {
float:none;
}
}

Test it on this resizable external Fiddle

enter image description here

关于html - 导航栏折叠在 Bootstrap 中无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41615210/

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