**I want to move label little bit up when clicked on input field with JavaScript or CSS if possible **
This is HTML Part
<div className="inputbox">
<div className="label">
<img src={icon} alt="" width={width} height={height} />
<label htmlFor={type}>{labelText}</label>
</div>
<input type={type} name={type} className="authInput" required />
</div>
CSS I tried
.inputbox input:focus ~ .label,
.inputbox input:valid ~ .label{
position: absolute;
top: -18px;
left: 0;
}