CSS :hover to affect all child divs -


i have parent div , multiple child divs inside. want if hover on parent div, affects hover state of thechild divs in separate ways (i.e. text of 1 div gets underlined, text of changes colour , div holds image makes image bit lighter - example). how can implement this?

here code i'm using:

<div id='main_categories_item'>      <div id='main_categories_item_image'>     <img src='http://www.ultimate-punch.com/images/small_icon/ironman.jpg'>     </div>      <div id='main_categories_item_text_container'>         <div id='main_categories_item_category'>culture review</div>         <div id='main_categories_item_short_subtitle'>our critique of latest iron man installment</div>         <div id='main_categories_item_date'>2nd april 2013</div>     </div> </div> 

in i'd want #main_categories_item_category change underline, #main_categories_item_short_subtitle change colour , #main_categories_item_image change opacity.

here's css i've got far:

#main_categories_item {     height: 100%;     width: 100%;     background-color: #f4f4f4;     border-bottom: 1px solid #fff;     padding: 10px;     overflow:auto;  } #main_categories_item_image {     float: left;     margin-right: 10px; } #main_categories_item_image img {     width: 64px;     height: 64px; } #main_categories_item_text_container{     float: right;     width: 146px;     height: 64px; } #main_categories_item_category {     font-family: trebuchet ms;     font-size: 14px;     text-transform: uppercase;     color: #991111;     height:17px; } #main_categories_item_short_subtitle {     font-family: trebuchet ms;     font-size: 12px;     color: #171717;     height: 36px; } #main_categories_item_date {     font-family: trebuchet ms;     font-size: 10px;     color: #575757; } 

thank you!

#main_categories_item_text_container:hover #main_categories_item_category {     text-decoration : underline; }  #main_categories_item_text_container:hover #main_categories_item_short_subtitle {     color : blue; }  #main_categories_item_text_container:hover #main_categories_item_image {     opacity : 0.5; } 

that should work


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -