这就是我所拥有的,我已经尝试在"品牌"中移动我的部分,并在品牌外部和折叠之外做一个向右拉动并做左/右拉,同时也尝试在之前或之后放置它崩溃部分.
将它添加到品牌部分时,它可以正常工作,但它会归结为新的一行.我如何将它保持在同一条线上?
<body>
<header>
<nav class="navbar navbar-default navbar-inverse" role="navigation" style="font-size: 18px">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand site-title" style="text-decoration: none; font-size: 24px; font-weight:bold">@Html.ActionLink("Manager", "Index", "Player")</div>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse navbar-right">
<ul class="nav navbar-nav">
@* <li class="active">@Html.ActionLink("Home", "Index", "Player")</li>
<li class="active">@Html.ActionLink("Match", "Index", "Match")</li> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Profile <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Change Password", "ManagePassword", "Account")</li>
<li>@Html.ActionLink("Update Profile Info", "UpdateProfile", "Account")</li>
<li>@Html.ActionLink("Log Off", "LogOff", …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Bootstrap 3创建一个不会折叠或包装文本的Navbar .我希望文本简单地被剪切掉(或省略)而不是包裹 - 因此Navbar保持在一条线上而不会垂直扩展.(此Navbar将用于显示具有单个右对齐菜单的当前视图位置)
像这样的东西:
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-header pull-left">
<p class="navbar-text" style="overflow: hidden; white-space: nowrap;">
Trying to get this long line of text to not wrap even if too wide for the view to display. Trying to get this long line of text to not wrap even if too wide for the view to display.
</p>
</div>
<div class="navbar-header pull-right">
<p class="navbar-text">Menu</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
如图所示,我一直在愚弄CSS浮动,溢出,空白设置,似乎无法得到正确的组合.此外,我使用两个navbar-header元素来避免崩溃,但如果有更好的方法,我会对其他选项持开放态度.
谢谢您的帮助.