html - CSS hover effect applying to everything but h4 -



html - CSS hover effect applying to everything but h4 -

i have next scenario:

i'm using bootstrap develop site. when hover list group, suppose have trnasition bluish background color , text should go white. works though styles don't apply h4.

here's css code:

.styled-group-right-item{ padding: 20px; margin-left: 100px; } .limited-list-group{ height: auto; max-height: 500px; overflow-y: scroll; } .author-pubdate-info{ font-weight: bold; } .list-group-item-switchhon-blog:hover{ transition: 0.5s ease !important; color: #fff !important; background-color: #2980b9 !important; } .list-group-item-switchhon-blog{ transition: 0.5s ease; }

and here markup:

<div class="list-group limited-list-group"> <a href="#" class="list-group-item clearfix list-group-item-switchhon-blog"> <div class="pull-left"> <img src="http://placehold.it/100x100" class="btn-center"> </div> <div class="styled-group-right-item"> <h4 class="list-group-item-heading">lorem ipsum dolor sit down amet</h4> <p class="list-group-item-text">lorem ipsum dolor sit down amet, consectetur adipiscing elit. sed eget interdum libero. vivamus pharetra faucibus.</p> <span class="author-pubdate-info">autor: john doe | fecha: 11 de noviembre de 2014</span> </div> </a> </div>

and here's fiddle: http://jsfiddle.net/y7d5fm1w/

what have tried far: add together class this:

.list-group-item-switchhon-blog:hover h4{ transition: 0.5s ease !important; color: #fff !important; background-color: #2980b9 !important; }

but creates funny effect, seek on fiddle, it's not good.

any ideas how apply styles h4, please i'm ears.

apply style h4 as well. also, place transition on non hover state; ensures transition apply in , out of hover state.

aside: if alter overflow-y: scroll overflow-y: auto, scrollbar if content overflows.

changes .list-group-item-switchhon-blog, .list-group-item-switchhon-blog h4 { /* transition here */ transition: 0.5s ease !important; } .list-group-item-switchhon-blog:hover { color: #fff !important; background-color: #2980b9 !important; } .list-group-item-switchhon-blog:hover h4 { /* add together */ color: #fff !important; } working example

class="snippet-code-css lang-css prettyprint-override">.styled-group-right-item { padding: 20px; margin-left: 100px; } .limited-list-group { height: auto; max-height: 500px; overflow-y: auto; } .author-pubdate-info { font-weight: bold !important; } .list-group-item-switchhon-blog, .list-group-item-switchhon-blog h4 { transition: 0.5s ease !important; } .list-group-item-switchhon-blog:hover { color: #fff !important; background-color: #2980b9 !important; } .list-group-item-switchhon-blog:hover h4 { color: #fff !important; } .list-group-item-switchhon-blog { transition: 0.5s ease; } class="snippet-code-html lang-html prettyprint-override"><link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/> <div class="list-group limited-list-group"> <a href="#" class="list-group-item clearfix list-group-item-switchhon-blog"> <div class="pull-left"> <img src="http://placehold.it/100x100" class="btn-center"> </div> <div class="styled-group-right-item"> <h4 class="list-group-item-heading">lorem ipsum dolor sit down amet</h4> <p class="list-group-item-text">lorem ipsum dolor sit down amet, consectetur adipiscing elit. sed eget interdum libero. vivamus pharetra faucibus.</p> <span class="author-pubdate-info">autor: john doe | fecha: 11 de noviembre de 2014</span> </div> </a> </div>

html css twitter-bootstrap

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -