Hey, I'm currently working on a project where I want to show and hide specific sections of cards by just hovering over the menu list. While I can successfully hide the cards using CSS, I am facing issues with displaying them using the display:block property for a specific class...
HTML
Navigation Menu
<div class="d-flex justify-content-center">
<ul class="nav">
<li class="nav-item">
<a class="nav-link itemOne" href="#">Product 1</a>
</li>
<li class="nav-item">
<a class="nav-link itemTwo" href="#">Product 2</a>
</li>
</ul>
</div>
Card Section
<div class="card item1" style="width:12rem;">
<img class="card-img-top item" src="../image1" alt="Card image cap">
<div class="card-body item1">
<h5 class="card-title item1">Card title</h5>
<p class="card-text item1">This is a wider card with supporting text
below as a natural lead-in to additional content. This content is a little
bit longer.</p>
</div>
</div>
<div class="card item2" style="width:12rem;">
<img class="../image2" alt="Card image cap">
<div class="card-body item2">
<h5 class="card-title item2">Card title</h5>
<p class="card-text item2">This is a wider card with supporting text below
as a natural lead-in to additional content. This content is a little bit
longer.
</p>
</div>
</div>
CSS
.item1{
display:none;
}
.item2{
display:none;
}
.itemOne:hover .item1{ //Currently not showing item 1
display:block;
}
.itemTwo:hover .item2{ //Currently not showing item 2
display:block;
}