JSFiddle - React, Tailwind, and code Playground
by Dmitriy Shvanyk
HTML
<div class="form-fields-group">
<input type="text" id="name" class="form-fields-input" placeholder="Введите название группы" required>
<label class="form-fields-group-label" for="name">Название Группы</label>
</div>
CSS
.form-fields-group{
position: relative;
}
.form-fields-group-label {
position: absolute; top: 0; left: 0;
font-size: 13px;
color: #27252a;
margin-top: 34px;
font-family: 'Roboto', sans-serif;
margin-left: 16px;
padding-top: 5px;
}
.form-fields-input {
margin-top: 34px;
padding: 30px 142px 8px 16px;
border: none;
background: #EAEAEE;
border-radius: 5px;
font-family: 'Roboto', sans-serif;
font-size: 15px;
}
.form-fields-input:focus + .form-fields-group-label{
color: #00f;
}