Within my Web Application, I have implemented HTML code that displays different texts above input fields based on certain conditions.
However, the issue I am facing is that the input fields are being shifted down by the text. I want the input fields to always remain in the same position, regardless of whether the @if($numberBookings > 0) condition is true or not, or even if I decide to replace the text with something completely different.
.bookbox{
padding-top: 10px !important;
padding-bottom: 10px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
background-color: #FFFFFF;
margin: 16px !important;
box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19);
flex-wrap: wrap;
}
.bookcard{
margin-top: 120px !important;
margin-bottom: 120px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
background-color: #FFFFFF;
clear: both;
width: 100%;
}
.float-left {
float: left !important;
}
.m-1 {
margin: 0.25rem !important;
}
<div class="bookbox">
<h3 class="" align="center">
Hello {{$user->firstName.' '.$user->lastName}},<br>
@if($numberBookings > 0)
<font color="red">You have bookings that have already expired!<br> Please release the vehicles if you no longer need them</font>
@else
Do you need a vehicle?
@endif
</h3>
<div class="bookcard flex-column">
<form class="w3-container" method="GET" action="{{config('app.PATH_TO_INDEX', '')}}/findCar">
<div class="float-left m-1">
<input type="text" name="Location" list="Locations" class="w3-input w3-border {{ $errors->has('Location') ? 'border-danger' : '' }}" placeholder="Location">
<datalist id="Locations">
@foreach($cities as $city)
<option value="{!! $city->name !!}"></option>
@endforeach
</datalist>
</div>
<div class="float-left m-1">
<input type="text" name="StartDate" class="date w3-input w3-border {{ $errors->has('StartDate') ? 'border-danger' : '' }}" id="f0date" placeholder="Start Date">
</div>
<div class="float-left m-1">
<input type="text" name="EndDate" class="date w3-input w3-border {{ $errors->has('EndDate') ? 'border-danger' : '' }}" id="f1date" placeholder="End Date">
</div>
<div class="float-left m-1">
<button type="submit" class="w3-button margin-small signalButton w3-hover-text-blue w3-blue-grey w3-hover-blue-grey w3-hover-opacity" id="submit0">Find Vehicle</button>
</div>
</form>
</div>
</div>