Check out example codes for "focus um elemento altera outro css". It will help you in understanding the concepts better.

Code Example 1

label {
    display: block;
    padding: 20px;
}

.grupo-input span {
    transition: margin-top .5s;
    margin-top: 0px;
    display: block;
}

.grupo-input input:hover + span {
    margin-top: -40px;
}

Learn ReactJs, React Native from akashmittal.com