gpt4 book ai didi

twitter-bootstrap - Bootstrap 导航栏品牌权重根据 Safari 中的下拉菜单更改

转载 作者:行者123 更新时间:2023-12-04 08:57:37 24 4
gpt4 key购买 nike

非常令人沮丧的问题,我无法弄清楚。仅在 Safari 中注意到,当我在固定导航栏中触发下拉菜单时,导航栏中所有文本的字体粗细都会发生变化,包括品牌文本。

这是之前导航栏的屏幕截图

navbar BEFORE

之后:

navbar AFTER hovering on dropdown menu

我在导航栏文本和自定义 CSS 下方包含了这些内容。谢谢你的帮助!

<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="/">Midge Raymond</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="hidden-sm"><a href="/">home</a></li>
<li><a href="/bio.html">bio</a></li>
<li class="dropdown">
<a href="/books" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="500">books <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/books/mylastcontinent.html">My Last Continent</a></li>
<li><a href="/books/forgettingenglish.html">Forgetting English</a></li>
<li><a href="/books/everydaywriting.html">Everyday Writing</a></li>
<li><a href="/books/everydaybookmarketing.html">Everyday Book Marketing</a></li>
</ul>
</li>
<li class="dropdown">
<a href="/books" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="500">other writing <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/otherwriting/articles.html">Articles</a></li>
<li><a href="/otherwriting/shortstories.html">Short Stories</a></li>
</ul>
</li>

<li><a href="/news.html">news & events</a></li>
<li class="hidden-sm"><a href="/blog">blog</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>

和 CSS:
.navbar {
min-height: 100px;
padding-top: 15px;
margin-bottom: 5px;
padding-left: 0px;
}

.navbar-toggle {
margin-top: 40px;

}

.navbar-brand {
font-family: 'EB Garamond', 'Garamond', serif;
font-size: 52px;
margin-top: 15px;
margin-bottom: 10px;
text-align: center;
font-weight: normal;
}

@media (max-width: 768px) {
.navbar-brand {
font-family: 'EB Garamond', 'Garamond', serif;
font-size: 34px;
}
.navbar-toggle {
margin-top: 15px; // Adjust toggle position
}
body { padding-top: 110px; }

}


.navbar-default .navbar-brand {
color: #ffffff;
font-weight: normal;
}

.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #488A87;
background-color: transparent;
}

.navbar-default {
background-color: #073949;
border-color: #aaaaaa;
}

.navbar-default .navbar-nav > li > a {
color: white;
font-size: 17px;
padding-top: 10px;
}

.navbar-inverse .navbar-brand {
color: #ffffff;
}

.navbar-default .navbar-nav > li > a:hover {
background-color: #E5E5E5;
}

@media (min-width:1024px) {
.navbar > .container {
text-align: center;
}
.navbar-header,.navbar-brand,.navbar .navbar-nav,.navbar .navbar-nav > li {
float: none;
display: inline-block;
}
.collapse.navbar-collapse {
float: none;
width: auto;
clear: none;
text-align: center;
}
}

.dropdown-menu {
background: #f9f9f5;
}

最佳答案

您需要将以下内容添加到您的 CSS 文件中以解决此问题。这是 position: fixed 出现的字体平滑问题和 Safari 。

.navbar-fixed-top {
-webkit-font-smoothing: antialiased;
}

您可以找到有关此修复程序及其发生原因的更多详细信息 here .

JSFiddle: https://jsfiddle.net/7njwmd1a/

关于twitter-bootstrap - Bootstrap 导航栏品牌权重根据 Safari 中的下拉菜单更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34421870/

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