gpt4 book ai didi

html - Bootstrap 下划线导航链接

转载 作者:行者123 更新时间:2023-11-28 04:54:54 25 4
gpt4 key购买 nike

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<!--<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
</ul>-->
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</div>
</nav>

我在处理这段代码时遇到了问题:

.navbar-default .navbar-nav > .active > a:after {
content: "";
position: absolute;
width: 100%;
height: 3px;
bottom: 0;
left: 0;
background-color: #1B94E1;

-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}

本质上,我想使用 CSS ::after 伪类来创建各种下划线。然而,似乎什么也没有发生。请注意,我正在使用 Bootstrap 并将这些样式应用于导航栏。谢谢!

这是一个代码笔:http://codepen.io/Hudson_Taylor11/pen/ZBGGXQ

最佳答案

这是工作代码笔

.navbar-default .navbar-nav a { border-bottom: 2px solid red; padding: 0px; margin: 15px; }

http://codepen.io/SESN/pen/QGbbmL

关于html - Bootstrap 下划线导航链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40470802/

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