我对某些按钮做了一些更改,现在我的导航栏项目在悬停时变大了,这是不希望的行为。
将鼠标悬停在导航栏中的徽标上时,这种现象更加明显。
Codepen:
https://codepen.io/anon/pen/jjEMZj
<nav class="navbar navbar-expand-md navbar-dark fixed-top navbar-bg">
<a class="navbar-brand" href="/">  <img src="https://stickers-gallito-uploaded-files.s3.amazonaws.com/static/img/stickers_gallito_logo.png" width="20px" height="30px"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/stickers">Stickers <span class="sr-only">(current)</span></a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="/carrito_de_compras/"><i class="fas fa-shopping-cart"
style="color:white !important;"></i> ( 3)</a>
</li>
<li class="nav-item active">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"><i class="fas fa-user-circle"></i> ogonzales</a>
<div class="dropdown-menu dropdown-menu-right">
<a href="/ordenes/historial_de_compras/" class="dropdown-item">Historial de compras</a>
</div>
</li>
<li class="nav-item active">
<a class="nav-link" href="/salir/">Salir <i class="fas fa-sign-out-alt"></i></a>
</li>
</ul>
</div>
</nav>
答案 0 :(得分:1)
这是由于footer.css
第38行:
li.footer_nav_links a:focus, a:hover {
font-size: 12px;
color: rgb(2, 214, 158);
text-decoration: none;
}
摆脱那里的font-size: 12px
就可以了。也许您以一种通用的方式使用a:hover
,所以当鼠标悬停时,它会影响所有<a>
标记。您是说li.footer_nav_links a:hover
吗?
li.footer_nav_links a:focus, li.footer_nav_links a:hover {
font-size: 12px;
color: rgb(2, 214, 158);
text-decoration: none;
}