Fix bug for home active link; enter button hover

This commit is contained in:
Nicolò P 2021-07-29 19:07:45 +02:00
parent 01cc8fff4d
commit 3d35886051
2 changed files with 10 additions and 1 deletions

View File

@ -66,6 +66,9 @@ header {
font-size: 0.9rem;
cursor: pointer;
}
#title button:hover {
background-color: rgba(254, 254, 254, 0.25);
}
/* ---- Navbar ----- */
.active {
color: #fff;font-weight:bold;

View File

@ -15,7 +15,7 @@
<img src="img/InnovaPatrimonio_logo_transparent_bg_150x98.png" alt="Logo InnovaPatrimonio" id="logo">
</div>
<div class="column col-5" id="links">
<a href="index.html" title="Torna alla home page">Home</a>
<a href="/" title="Torna alla home page">Home</a>
<a href="progetto.html" title="Vai alla descrizione del progetto">Il progetto</a>
<a href="itinerario.html" title="Vai all'itinerario">L'itinerario</a>
<a href="news.html" title="Leggi news ed eventi">News & Eventi</a>
@ -44,6 +44,12 @@
if (window.location.href.includes(ref)) {
element.setAttribute('class', 'active');
}
/**
* @todo Take / location into account for Home!
*/
if (window.location.href = '/') {
navlinks[0].setAttribute('class', 'active');
}
});
});