Bonjour,
Je ne comprends pas pourquoi, dans l'exemple suivant, les deux liens "test1" et "test2" s'affichent en rouge alors que "test2" devrait s'afficher en vert.
Qqn peut-il expliquer pourquoi le cascading ne s'applique pas, et si il y a moyen de résoudre ce problème en sachant que j'aimerais appliquer un style par défaut aux liens de "mondiv" ?
Merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style type="text/css"> #mondiv a:link { color: #ff0000; text-decoration: none; } #mondiv a:hover { color: #ff0000; text-decoration: underline; } #mondiv a:active { color: #ff0000; text-decoration: none; } #mondiv a:visited { color: #ff0000; text-decoration: none; } a.maclasse:link { color: #00ff00; text-decoration: none; } a.maclasse:hover { color: #00ff00; text-decoration: underline; } a.maclasse:active { color: #00ff00; text-decoration: none; } a.maclasse:visited { color: #00ff00; text-decoration: none; } </style> </head> <body> <div id="mondiv"> <a href="#">test1</a> <br/> <a href="#" class="maclasse">test2</a> </div> </body> </html>
Partager