I have a div and when i hover that div i want to call another css class. I have used some ways i've found but i cannot get it to work.
html code
<div className="trait_box polaroid">
<div className="trait_description_div">
<span className="trait_description">Honesty</span>
</div>
<div className="trait_img_div">
<img src={Honesty} className="trait_img"/>
</div>
<div className="block__body">
<h3>Card Title</h3>
</div>
</div>
SO when i hover trait_box class i want to load block__body class. How can i do it?
I've tried the following way but did not work and it showed some errors in red lines.
.trait_box {
width: 220px;
height: 240px;
display: inline-block;
background-color: white;
margin-right: 35px;
cursor: pointer;
&:hover .block__body {
position:absolute;
top:0;
background:#2980b9;
color:#fff;
height:100%;
transition: top .5s;
h3 { color: #fff; }
}
}
<div class="className">. Where do you need to useclassattribute asclassName??