答案 0 :(得分:0)
如果您使用的是bootstrap,还有一些预定义的CSS,您可以尝试查看本网站bootstrap nav links中的css设置,只有图片,很难确定问题的确切位置
答案 1 :(得分:0)
将您的导航包裹在
中“容器流体”
所以需要整页宽度。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Business</a></li>
<li><a href="#">Add</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Plan</a></li>
<li><a href="#">Member</a></li>
</ul>
</div>
</nav>
<div class="container">
<h3>Basic Navbar Example</h3>
<p>Wrap your navigation In "container-fluid"</p>
</div>
</body>
</html>
答案 2 :(得分:0)
您需要添加以下内容,以将导航项文本拉伸为一行:
flex-shrink:0; //这将引起问题
完整示例:
.nav {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
flex-shrink: 0;
> * {
flex-shrink: 0; // this is imp
}
}