▽1
●
Cherenkov ●200ポイント ベストアンサー |
#header-menu a { color: black !important; background-color: #9cc86f !important; padding: 0px 5px 0px 5px !important; } #header-menu a:hover { font-size: 20px; color: green !important; } #header-menu a.here { color: white !important; background-color: #cae6b5 !important; } #header-menu a.here:hover { color: green !important; background-color: #cae6b5 !important; }
(function() { var h = document.getElementById('header-menu').getElementsByTagName('a'); var cache; for (var i=0, n=h.length; i<n; i++) { var self = h[i]; if (RegExp(self.textContent).test(decodeURIComponent(location.href))) { if (cache) { cache.className = cache.className.replace(/here/,''); } cache = self; self.className += ' here'; } } })();