I have a form with flexbox
, only when an error is entered a div
of alert
, breaking layout
.
There are some fields that are 50% on the same line
<form method="post" action="XXX" class="form-login">
@if($message = session('message'))
<div class="alert-error">
{{ $message }}
</div>
@endif
<div class="form-group">
<label for="">E-mail</label>
<input type="email" name="xxx" value="{{ old('xxx') }}">
</div>
<div class="form-group">
<label for="">Senha</label>
<input type="password" name="xxx" value="{{ old('xxx') }}">
</div>
<button class="btn btn-logar">
Logar
</button>
</form>
And in css
I have
.form-login.form-group:nth-of-type(1),
.form-login.form-group:nth-of-type(2) {
width: 48.3%;
flex: 1 0 auto;
}
This happens because I am using nth-of-type
, what would be workaround
?