1 回答
TA贡献1909条经验 获得超7个赞
只需添加一个自定义类并为您的导航提供全宽。您的导航有display: flex;。因此您可以使用 justify-content: space-between; 来分发您的图标:
.custom-nav {
justify-content: space-between;
width: 100%;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js" integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs=" crossorigin="anonymous"></script>
<nav class="navbar navbar-expand navbar-light bg-light fixed-bottom" style="padding-top: 0px; padding-bottom: 0px; width: 100%;">
<div class="bottom-nav navbar-nav custom-nav" style="height: 100%; margin: 0px auto;">
<a href="#law" data-rb-event-key="#law" class="nav-icon fa-2x nav-link">
<i class="fas fa-star"></i>
</a>
<a href="#bar" data-rb-event-key="#bar" class="nav-icon fa-2x nav-link">
<i class="fas fa-glass-cheers"></i>
</a>
<a href="#restaurant" data-rb-event-key="#restaurant" class="nav-icon fa-2x nav-link">
<i class="fas fa-utensils"></i>
</a>
<a href="#store" data-rb-event-key="#store" class="nav-icon fa-2x nav-link">
<i class="fas fa-store"></i>
</a>
</div>
</nav>
- 1 回答
- 0 关注
- 63 浏览
添加回答
举报