Currently, I have created dropdowns in CSS using the following code:
.menu ul ul,
.menu .mega-menu,
.menu .mega-menu ol li {
opacity: 0;
visibility: hidden;
}
.menu li:hover > ul,
.menu li:hover > .mega-menu,
.menu li:hover > .mega-menu ol li {
opacity: 1;
visibility: visible;
}
I am looking to make these dropdowns clickable instead of just hover. Would it be possible to achieve this using :target?
I attempted the following:
.menu li:focus > ul,
.menu li:focus > .mega-menu,
.menu li:focus > .mega-menu ol li {
opacity: 1;
visibility: visible;
}
Unfortunately, this did not work as expected.
<div class="menu menu-style">
<ul class="menu brand-background">
<li class="menu-active">A</li>
<li>B</li>
<li>
<a href="#">C</a>
<!-- Full Width Mega-Menu / Start -->
<div class="mega-menu full-width">
<div class="col-md-1">
<h4>Content</h4>
<ol>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">6</a></li>
<li><a href="#">7</a></li>
</ol>
</div>
</div>
<!-- Full Width Mega-Menu / End -->
</li>
<li><a href="#">D</a></li>
</ul>
</div>