如果我使用margin-left:800px,则可以使用,但是不能使用auto。
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
header{
display: flex;
justify-content: flex-start;
align-items: center;
padding: 10px 10px;
}
nav{
font-family: "Montserrat", sans-serif;
font-weight: 500;
font-size: 16px;
margin-left: 15px;
}
.nav__links_R, .nav__links_L, a {
text-decoration: none;
list-style: none;
float: left;
color:rgba(0, 0, 0, .50);
}
.nav__links_R {
margin-left: auto;
}
.nav__links_L li {
display: inline-block;
padding: 0px 20px;
}
.nav__links_R li {
display: inline-block;
padding: 0px 20px;
}
<header>
<img src="../photo/logo_dark.png" alt="logo">
<nav>
<ul class=nav__links_L>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
<ul class=nav__links_R>
<li><a href="#">Register</a></li>
<li><a href="#">Login</a></li>
</ul>
</nav>
</header>
一切都按预期进行。只有“ .nav__links_R”不在带有“ auto”的右侧
答案 0 :(得分:0)
将以下两个样式规则添加到begin
model = Model.where(...).paginate(page: params[:page])
<additional code>
rescue
model = Model.where(...).paginate(page: '1')
<redo additional code again or use function***>
:
current_page = clean_page(params[:page])
model = Model.where(...).paginate(page: current_page)
nav
width: 100%;
display: flex;