How can I prevent my ul.SideNav_Main li a:focus
class from losing focus when I click on the iframe or elsewhere on the page? Shouldn't it maintain focus until I click on another URL in the list?
Is it possible to solve this issue with just CSS, or would some JavaScript code be necessary?
My CSS:
ul.SideNav_Main {
font-weight: bold;
background-color: #ebf6f9;
list-style-type: none;
margin: 0;
padding: 0;
width: 15%;
height: 100%;
border-right: 1px solid #e6e6e6;
position: fixed;
overflow: auto;
}
ul.SideNav_Main li a {
text-decoration: none;
color: #2e849e;
padding: 10px 20px;
display: block;
}
ul.SideNav_Main li a:focus:not(.Active):not(.Logout) {
background-color: #ffdb99;
}
ul.SideNav_Main ul.SideNav_Sub {
font-size: 10px;
font-weight: normal;
width: 100%;
margin: 0;
padding: 0;
list-style-type: none;
overflow: auto;
}
My HTML:
<ul class="SideNav_Main">
<li><a class="Active" href="yPage.php?ID=30000" target="_iframe">HOME</a></li>
<li>
<a href="#">RaspLot</a>
<ul class="SideNav_Sub" id="T101">
<li><a href="yPage.php?ID=10101" target="_iframe">Controlo Diário</a></li>
<li><a href="yPage.php?ID=10102" target="_iframe">Balanços</a></li>
<li><a href="yPage.php?ID=10103" target="_iframe">Consultar Artigos</a></li>
<li><a href="yPage.php?ID=10104" target="_iframe">Inserir Artigos</a></li>
</ul>
</li>
<li>
<a href="#">Segurança</a>
<ul class="SideNav_Sub" id="T301">
<li><a href="yPage.php?ID=30101" target="_iframe">Alterar Password</a></li>
<li><a href="yPage.php?ID=30102" target="_iframe">Alterar eKey</a></li>
</ul>
</li>
<li>
<a href="#">Master</a>
<ul class="SideNav_Sub" id="T398">
<li><a href="yPage.php?ID=39801" target="_iframe">Registry Access</a></li>
<li><a href="yPage.php?ID=39802" target="_iframe">Registry Alert</a></li>
<li><a href="yPage.php?ID=39803" target="_iframe">Explorer SSID</a></li>
<li><a href="yPage.php?ID=39899" target="_iframe">Print_r</a></li>
</ul>
</li>
<li><a class="Logout" href="yPage.php?ID=39900" target="_parent">Logout</a></li>
</ul>