JSFiddle - React, Tailwind, and code Playground

by Rafael Nepomuceno

HTML

<div class="subdiv1">
    <div class="subdiv2">
        <div class="subdiv3_thisdiv"></div>
        
        <div class="socialicons">
            <div class="icon facebook"></div>
            <div class="icon twitter"></div>
            <span class="icon googleplus"></span> <!-- only span test... -->
        </div>
        
    </div> <!-- subdiv2 -->
</div> <!-- subdiv1 -->

CSS

.subdiv1 {
    padding: 15px 15px;
    margin: 30px;
    height: 45px;
    background: #EEEEEE;
}
.subdiv1 .subdiv2 {
    position:relative;
}
.subdiv1 .subdiv2 .subdiv3_thisdiv:before {
    position: absolute;
    left: 0;
    color: #979797;
    text-shadow: 1px 1px #DDDDDD;
    content:'Share This!';
    font-size: 38px;
}
.subdiv1 .subdiv2 .socialicons {
    font-family: FontAwesome;
    font-size: 20px;
    float: right;
}
.subdiv1 .subdiv2 .socialicons .icon {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    line-height: 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-left: 10px;
    color: #DDDDDD;
    background: #979797;
    text-shadow: 0 0 1px #555;
    
    transition: all 0.5s ease 0s;
    -webkit-transition: all 0.5s ease 0s;
}

.facebook:before{
	content: "\f09a";
}
.twitter:before{
	content: "\f099";
}
.googleplus:before{
	content: "\f0d5";
}

.subdiv1 .subdiv2 .socialicons .icon.facebook:hover{
    background: #4862A3;
}
.subdiv1 .subdiv2 .socialicons .icon.twitter:hover{
    background: #55ACEE;
}
.subdiv1 .subdiv2 .socialicons .icon.googleplus:hover{
    background: #D73D32;
}

/* This not work! */
div[class="facebook"]:hover ~ .subdiv1 .subdiv2 .subdiv3_thisdiv:before {
    color: #4862A3;
    content:'Facebook';
}
div[class="twitter"]:hover ~ .subdiv1 .subdiv2 .subdiv3_thisdiv:before {
    color: #55ACEE;
    content:'Twitter';
}
span[class="googleplus"]:hover ~ .subdiv1 .subdiv2 .subdiv3_thisdiv:before {
    color: #D73D32;
    content:'Google Plus';
}