Ce code représente le texte explicatif sous forme rectangulaire verte en position relative
Exemple avec hover:
Survolez le mot "Alsace" région française capitale de la choucroute ou survolez le mot "Strasbourg"ville alsacienne où il fait bon vivre pour obtenir des explications.
Codage CSS de l'exemple:
a.info {
position: relative;
border-bottom: 1px gray dotted;
text-decoration: none;
color: black;
}
a.info span {
display: none;
}
a.info:hover {
background: none;
z-index: 500;
}
a.info:hover span {
display: inline;
position: absolute;
z-index: 500;
top: 2em;
left: 1em;
background: green;
text-align: center;
color: white;
padding: 0.2em;
}
| Code HTML pour afficher le style CSS
<html> |