https://i.sstatic.net/e6Lor.png
Once validations are added, the error message is displayed within the width of that div. How can I adjust the width to make the error message fit on a single line? Alternatively, if there are other methods for front-end validations, please provide suggestions.
.age {
width: 53px;
font-weight: 700;
font-size: 16px;
letter-spacing: 0.15px;
color: rgba(0, 0, 0, 0.6);
}
.input-group {
margin-bottom: 9px;
position: relative;
}
.input-group__label {
z-index: 5;
display: block;
position: absolute;
top: 0;
line-height: 40px;
color: #aaa;
left: 5px;
padding: 0 7px;
transition: line-height 200ms ease-in-out, font-size 200ms ease-in-out, top 200ms ease-in-out;
pointer-events: none;
font-weight: 700;
font-size: 16px;
letter-spacing: 0.15px;
color: rgba(0, 0, 0, 0.6);
}
.input-group__input {
width: 100%;
height: 40px;
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 4px !important;
padding: 0 10px;
}
<div class="input-group age">
<input class="input-group__input form-control is-invalid"
type="text"
placeholder=" "
name="age"
id="validationError"
autocomplete="off"
required />
<label class="input-group__label" for="age">Age</label>
<div class="invalid-feedback">
Please enter an age between 35-74
years.
</div>
</div>