par
goudurisc » 25 janv. 2012, 04:09
Bonjour,
Je souhaiterais que mes rubriques prennent classiquement le style a:hover quand elles sont actives. Je dispose donc de :
Fichier include pour ma navigation :
<ul id="headerNav">
<li<?php if ($nav_en_cours == 'rub1') {echo ' id="en-cours"';} ?>><a href="notre-approche.php">Notre Approche</a></li>
<li<?php if ($nav_en_cours == 'rub2') {echo ' id="en-cours"';} ?>><a href="contact.php">Contact</a></li>
</ul>
Sur ma page "Notre approche" par exemple :
<?php $nav_en_cours = 'rub1'; ?>
Puis "rub2", "rub3"... pour les autres rubriques
Sur mon css :
Code : Tout sélectionner
#headerNav {
width: 100%;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 13px;
color: #1A262F;
text-align: center;
background-image: url(img/degBarnav.png);
background-repeat: repeat-x;
height: 58px;
float: left;
margin-bottom: 30px;
padding-top: 18px;
}
#headerNav ul {
list-style-type: none;
}
#headerNav li {
display: inline;
margin-left: 5px;
margin-right: 10px;
background-image: url(img/pucBarnav.png);
background-repeat: no-repeat;
background-position: left;
padding-left: 30px;
}
#headerNav a {
color: #1A262F;
text-decoration : none;
}
#headerNav a:hover, #headerNav a:focus {
color: #0E92BC;
text-decoration : none;
}
#headerNav #en_cours a {
color: #0E92BC;
text-decoration : none;
background-color: #F33;
}
...et je ne vois pas où ça bugue

Bonjour,
Je souhaiterais que mes rubriques prennent classiquement le style a:hover quand elles sont actives. Je dispose donc de :
Fichier include pour ma navigation :
[php]<ul id="headerNav">
<li<?php if ($nav_en_cours == 'rub1') {echo ' id="en-cours"';} ?>><a href="notre-approche.php">Notre Approche</a></li>
<li<?php if ($nav_en_cours == 'rub2') {echo ' id="en-cours"';} ?>><a href="contact.php">Contact</a></li>
</ul>[/php]
Sur ma page "Notre approche" par exemple :
[php]<?php $nav_en_cours = 'rub1'; ?>
[/php]
Puis "rub2", "rub3"... pour les autres rubriques
Sur mon css :
[code]#headerNav {
width: 100%;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 13px;
color: #1A262F;
text-align: center;
background-image: url(img/degBarnav.png);
background-repeat: repeat-x;
height: 58px;
float: left;
margin-bottom: 30px;
padding-top: 18px;
}
#headerNav ul {
list-style-type: none;
}
#headerNav li {
display: inline;
margin-left: 5px;
margin-right: 10px;
background-image: url(img/pucBarnav.png);
background-repeat: no-repeat;
background-position: left;
padding-left: 30px;
}
#headerNav a {
color: #1A262F;
text-decoration : none;
}
#headerNav a:hover, #headerNav a:focus {
color: #0E92BC;
text-decoration : none;
}
#headerNav #en_cours a {
color: #0E92BC;
text-decoration : none;
background-color: #F33;
}[/code]
...et je ne vois pas où ça bugue :shock: