<div class="form-group form-default form-spacing">
<input class="form-control" placeholder="Name" type="text" required>
<span class="form-bar"></span>
<label class="float-label">Name</label>
</div>
here is css,
.form-material {
.form-group {
position: relative;
&.form-static-label .form-control {
~.float-label {
top: -14px;
}
}
}
.form-control {
&:focus {
border-color: transparent;
outline: none;
box-shadow: none;
}
&:focus,
&:valid {
~.float-label {
top: -14px;
}
}
}
if i focus on text field it works fine. but when there is no focus it's overlapping. asdasd dasd dasdsad ad asd das dasd asd a das
You can try this code using angular material you can simply solve this kind of issues.
try this please:
in app.module.ts :
html:
CSS:
Typescript Component: