Ответ 1
Ваш последний input
не последний ребенок - это ваш button
.
Используйте :last-of-type
вместо этого, чтобы выбрать последний input
:
input {
margin-bottom: 0px;
&:last-of-type {
margin-bottom: 10px;
}
}
Я использую less
и пытаюсь получить last, чтобы иметь margin-bottom 10px
. Вот то, что у меня есть, но оно не работает и не применяет край поля на последнем входе. Любые идеи, почему?
input {
margin-bottom: 0px;
&:last-child {
margin-bottom: 10px;
}
}
И HTML
<form id="auth-form">
<input id="ember367" class="ember-view ember-text-field" placeholder="Email" type="email" name="email">
<input id="ember368" class="ember-view ember-text-field" placeholder="Password" type="password" name="password">
<div class="clear"></div>
<a class="pull-left forgot-password">Forgot password?</a>
<button class="pull-right" data-ember-action="1" type="button">Sign In</button>
</form>
Ваш последний input
не последний ребенок - это ваш button
.
Используйте :last-of-type
вместо этого, чтобы выбрать последний input
:
input {
margin-bottom: 0px;
&:last-of-type {
margin-bottom: 10px;
}
}