|
|
|
|
Bonjour,
Dans mon css, j'ai mis:
a:hover {
color : #ffffff;
text-decoration : none;
background-color : #4c0000;
font-style : normal;
}
Ce qui signifie que le lien aura un background plutot rouge (4c0000). Mais dans la ban j'ai voulu mettre un lien menant a l'index. Et a cause de ce a:hover je n'arrive pas a enlever ce background rouge qui s'affiche juste derriere l'image.
J'ai voulu créer un img{ ... } mais quoi que je mette a part border-width: 0; il ne veut rien entendre et laisse ce background.
Avez vous une idée pour le retirer ?
Merci d'avance.
Configuration: Windows XP Firefox 2.0.0.4
Qu'est ce que tu veux dire par la ?
|
J'ai donné la partie du code qui gènere le background-color sur l'image. Mais voici tout le code source:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Un titre</title> <style type="text/css" media="screen">@import "style.css";</style> </head> <body> <p>Une ban: <a href="index.html"><img src="http://www.google.fr/intl/fr_fr/images/logo.gif" alt="Test"/></a> </p> <p>Un lien: <a href="#">Un lien!</a> </p> </body> </html> (Bon il est pas xhtml w3c validator only pour l'exemple) :] et le style.css: html {
position : absolute;
overflow : scroll;
}
body {
height : 50px;
font-family : Arial;
}
img {
border-width : none;
border : none;
border-style: none;
}
a:link {
color : red;
text-decoration : none;
font-weight : normal;
font-style : normal;
}
a:visited {
color : red;
text-decoration : none;
font-weight : normal;
font-style : normal;
}
a:hover {
color : #ffffff;
text-decoration : none;
background-color : green;
font-style : normal;
}
a:active {
color : green;
text-decoration : none;
font-style : normal;
}
Voila. Si vous testez, vous remarquerez une barre en dessous du logo de google ! c'est cette barre que je veux retirer, et les a:* me gene :( Merci de votre aide. |
L'image est décalée vers le haut.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Un titre</title> <style type="text/css" media="screen"> img { border : none; } a:link { color : red; text-decoration : none; font-weight : normal; font-style : normal; } a:visited { color : red; text-decoration : none; } a:hover { color : #ffffff; text-decoration : none; background-color : green; font-style : normal; } a:active { color : green; text-decoration : none; } a.image:hover{ background-color:transparent; } </style> </head> <body> <p>Une ban: <a href="index.html" class="image"><img width="276px" height="110px" src="http://www.google.fr/intl/fr_fr/images/logo.gif" alt="Test"/></a> </p> <p>Un lien: <a href="#">Un lien!</a> </p> </body> </html> ps : les autres règles sont à mon avis inutiles. [ Mathieu ] Il y a surement des pandas pour ne dépendre de rien… |