gpt4 book ai didi

html - Bootstrap 固定导航链接更改对齐方式

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

这是一个 BigCommerce 网站。我添加了一个包含链接、跨度和 div 的 Bootstrap 固定导航栏。不确定我是否正确设置了 CSS,但一切似乎都很好,直到我单击其中一个链接……这是一个全局大商业登录/注销链接。最初它显示为两个链接:“登录”或“创建帐户”,它们正确对齐,没问题。当有人单击其中一个并登录按钮时,该按钮将变为“退出”。当它更改为“注销”时,它会稍微凸起并且不再正确对齐。请参阅下面的屏幕截图。

Everything looks cool:

Not so much now:

    %%GLOBAL_OptimizerLinkScript%%   
<link rel="stylesheet" type="text/css" href="%%GLOBAL_AppPath%%/javascript/jquery/themes/cupertino/ui.all.css?%%GLOBAL_JSCacheToken%%" />
<div id="TopMenu" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">

<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#GiftsByType">Gifts By Type<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="GiftsByType">
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/wine-gifts/" title="View Wine Gifts">Wine Gifts</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/tea-gifts/" title="View Tea Gifts">Tea Gifts</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/gourmet-gifts/" title="View Gourmet Gifts">Gourmet Gifts</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/spa-baskets/" title="View Spa Baskets">Spa Baskets</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/corporate/" title="View Corporate">Corporate</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/chocolate-lovers/" title="View Chocolate Lovers">Chocolate Lovers</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#Occasions">Occasions<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="Occassions">
<li role="presentation"><a role="menuitem" tabindex="-1" data-target="#" href="http://bluebasilgifts.mybigcommerce.com/4th-of-july/" title="View 4th of July Gifts">4th of July</a></li>
</ul>
</li>
<li><a href="/">&nbsp;Home&nbsp;</a></li>
</ul>



<ul class="nav" style="float: right;">
<div class="pull-right">
%%Panel.HeaderSearch%%
</div>
<span>%%GLOBAL_LoginOrLogoutText%%</span>
<li><a href="%%GLOBAL_ShopPath%%/account.php">%%LNG_YourAccount%%</a></li>



<li class="CartLink" style="display:%%GLOBAL_HideCartOptions%%">
<span><a href="%%GLOBAL_ShopPathNormal%%/cart.php" title="%%LNG_ViewCart%%"><i class="icon-large sprite-glyphicons_halflings_115_shopping-cart2x icon-2x" style="position: relative; top: 15px; right: 35px;"></i><span class="badge badge-info" style="position: relative; top: 19px; right: 30px;">0</span></span></a>
</li>
</ul>
</div>
</div>
</div>

CSS:

.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
padding-left: 0;
padding-right: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
.navbar-fixed-top {
top: 0;
}
.navbar-fixed-bottom {
bottom: 0;
}
.navbar .nav {
position: relative;
left: 0;
display: block;
float: left;
margin: 0 10px 0 0;
}
.navbar .nav.pull-right {
float: right;
}
.navbar .nav > li {
float: right;
margin-top: 0px;
}
.navbar .nav > li > a {
float: none;
vertical-align: middle;
padding: 20px 15px 20px;
color: #7d7d7d;
font-family: 'Lora', serif;
font-size: 14px;
text-transform: uppercase;
text-decoration: none;
/*text-shadow: 0 1px 0 #ffffff;*/
}
.navbar .nav > li > a:hover {
background-color: #e0e0e0;
color: #888888;
text-decoration: none;
}
.navbar .nav > li > a:focus,
.navbar .nav > li > a:hover {
background-color: #e0e0e0;
color: #888888;
text-decoration: none;
}
.navbar .nav > span {
color: #7d7d7d;
float: right;
margin-top: 19px;
display: inline;

}
.navbar .nav > span > a {
float: none;
vertical-align: middle;
padding: 20px 7px 20px 7px;
color: #7d7d7d;
font-family: 'Lora', serif;
font-size: 14px;
text-transform: uppercase;
text-decoration: none;
/* text-shadow: 0 1px 0 #ffffff; */
}
.navbar .nav > a {
float: right;
margin-top: 18px;

}
.navbar .nav > a {
float: none;
vertical-align: middle;
padding: 20px 8px 20px 8px;
color: #7d7d7d;
font-family: 'Lora', serif;
font-size: 14px;
text-transform: uppercase;
text-decoration: none;
/* text-shadow: 0 1px 0 #ffffff; */
}
.navbar .nav > span > a:focus,
.navbar .nav > span > a:hover {
background-color: #e0e0e0;
color: #888888;
text-decoration: none;
}

最佳答案

看来我自己已经解决了这个问题......虽然可能更多的是“解决方法”而不是合法的修复。

更改了 CSS 中受影响的跨度的一些对齐方式。将 vertical-align 从 middle 更改为 bottom 并为 .navbar 添加了 margin-top .nav > span of 20px:

.navbar .nav > span {
color: #ffffff;
float: left;
margin-top: 20px;
display: inline;
}

.navbar .nav > span > a {
float: none;
vertical-align: bottom;
padding: 20px 7px 20px 7px;
color: #7d7d7d;
font-family: 'Lora', serif;
font-size: 14px;
text-transform: uppercase;
text-decoration: none;
/* text-shadow: 0 1px 0 #ffffff; */

关于html - Bootstrap 固定导航链接更改对齐方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19408629/

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