我可以在常用的Navbar导航项目上使用轮廓样式的按钮,但是当它是“导航项目”下拉菜单时,该按钮未显示其边框,请参见下图。有什么办法让它显示边框?
<!-- Dropdown -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle btn-outline-secondary" href="#" id="navbardrop" data-toggle="dropdown" role="button">
Disprofarma
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/PedidoDisprofarma/Index">Pedidos</a>
<a class="dropdown-item" href="/RecepcionDisprofarma/Index">Recepción de Pedidos</a>
</div>
</li>
答案 0 :(得分:1)
不确定,为什么在这里使用nav-item
,但是如果要使用btn-outline-secondary
类,那么还需要添加btn
类,see here >
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<!-- Dropdown -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle btn btn-outline-secondary" href="#" id="navbardrop" data-toggle="dropdown" role="button">
Disprofarma
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/PedidoDisprofarma/Index">Pedidos</a>
<a class="dropdown-item" href="/RecepcionDisprofarma/Index">Recepción de Pedidos</a>
</div>
</li>
</body>