Hello all, I’m trying to add a hover effect on an unordered list (wikitext) such that the line you’re hovering over gets a yellow background. When nesting is involved, this fails due to how the HTML is generated, is there a CSS solution that will work?
Meaning when applying just to li:hover
and hovering over “Line B1” I want this:
But it instead does this:
If I write the html directly like here in the below (3rd chunk) then it works, but ideally I could keep using wikitext. Ideas?
<style>
.mylist ul li:hover { background-color:yellow; }
</style>
<div class="mylist">
<!-- Wikitext -->
* Line A
* Line B
** Line B1
* Line C
<!-- Converts to -->
<ul>
<li>Line A</li>
<li>Line B
<ul>
<li>Line B1</li>
</ul>
</li>
<li>Line C</li>
</ul>
<!-- Instead of this (which would work) -->
<ul>
<li>Line A</li>
<li>Line B</li>
<ul>
<li>Line B1</li>
</ul>
<li>Line C</li>
</ul>
</div>