Here is the jsfiddle. The HTML:
<div class="myDiv">
<div class="subDiv">hover me</div>
</div>
The CSS:
.myDiv{
width: 200px;
height: 20px;
border: 5px solid rgba(255,166,9,0.1);
}
.subDiv{
text-decoration: underline;
text-align: center;
cursor: pointer;
}
.subDiv:hover{
color: #ffa609;
transition: all 1s;
}
.subDiv:hover.myDiv{
border: 5px solid rgba(255,166,9,1);
}
What I want is:
The color of text and orange border will be changed when text is hovered.
My solution is:
.subDiv:hover{
color: #ffa609;
transition: all 1s;
}
.subDiv:hover.myDiv{
border: 5px solid rgba(255,166,9,1);
}
It seems that only the first hover is working. Could someone tell me why or other solutions? (Pure CSS please)