I have a div which has an image as the background and some text over it in an other div. Here is the HTML
.profilePic{
width:190px;
height: 190px;
border-radius: 50%;
background: #FFF;
float: left;
margin:12px;
background: #ededed;
background-image: url("https://www.meggle-pharma.com/images/meggle_icons/company-aktiv-190x190.png");
}
.profilePic:hover{
-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);
color:#FFF;
}
.name{
font-family: Tahoma;
font-size: 1.5em;
color: red;
margin-top: 42%;
display: none;
}
.profilePic:hover .name {
display:block;
}
<div class='profilePic one'>
<center>
<div class='name'>Name</div>
</center>
</div>
With this code, when I hover on the div named profilePic
, the div gets a filter applied on top of it. I dont what the filter on the text, i.e, the div named name
but only on the profilePic
div. How can I do it?