简体   繁体   中英

Change span color on div hover

Sorry if this is stupid question but i really don't know what problem is.I am trying to change color of span on div's hover but my code doesn't seems to work.
Here is code i'am using:

HTML

<div class="slike_i_text">


    <a href="#"><div>
    <img align="left" src="wolf.jpg"/><span>Text 1</span></div></a>

    <a href="#"><div>
    <img align="left" src="wolf.jpg"/><span>Text 2</span></div></a>



</div>

CSS

.slike_i_text div{
    overflow: hidden;
    width:300px;
    margin-bottom: 10px;
    text-decoration: none;
}
.slike_i_text div img{
    width:80px;
    height:80px;
}
.slike_i_text div span{
    color: #6A6A6A;
font-family: arial;
font-size: 15px;
font-weight: bold;
}
.slike_i_text a{
    text-decoration: none;
}
.slike_i_text div:hover  .slike_i_text div span{
    color:lightgreen;

}

You can find my fiddle here .

You may try this ( Updated Fiddle Example ):

.slike_i_text div:hover span{
    color:lightgreen;
}

Instead of this:

.slike_i_text div:hover  .slike_i_text div span{
    color:lightgreen;
}

You don't have to go like .slike_i_text div:hover .slike_i_text div span instead you should use .slike_i_text div:hover span .

fiddle here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM