html - Create hover effect on a div or button -


i trying create hover-over effect div font-awesome icon inside. tried making button out of because div doesnt have href (the "link" points overlay), here no luck. how create hover-over effect on fa icon has no href?

.read-more {      padding: 5px 10px;      display: inline-block;      -moz-border-radius: 140px;      -webkit-border-radius: 140px;      border-radius: 100px;      -moz-box-shadow: 0 0 2px #888;      -webkit-box-shadow: 0 0 2px #888;      box-shadow: 0 0 2px #888;      background-color: #fff;      opacity:0.7;      color: #888;      position: absolute;      left: 50%;      top: 50%;      transform: translate(-50%,-50%);  }        .read-more:hover {      	color:#fff;      	background-color:#000;      }
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>  <a href="#" target="_blank">      <div class="well carousel">          <div class="product-detailscar">              <div class="image-video-linkcar">                  <img alt="#" src="htpp://lorempixel.com/300/300">                                    <div class="brandcar">                    brand                  </div>                  <div class="categorycar">                     category                  </div>                  <div class="read-more">                      <i aria-hidden="true" class="fa fa-file-text-o fa-2x"></i>                  </div>              </div>          </div>      </div></a>

the problem applying hover styling parent element instead of i:

.read-more {      padding: 5px 10px;      display: inline-block;      -moz-border-radius: 140px;      -webkit-border-radius: 140px;      border-radius: 100px;      -moz-box-shadow: 0 0 2px #888;      -webkit-box-shadow: 0 0 2px #888;      box-shadow: 0 0 2px #888;      background-color: #fff;      opacity:0.7;      color: #888;      position: absolute;      left: 50%;      top: 50%;      transform: translate(-50%,-50%);  }        .read-more i:hover {      	color:#fff;      	background-color:#000;      }
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>  <div class="read-more">    <i class="fa fa-file-text-o fa-2x" aria-hidden="true"></i>  </div>


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -