CSS z-index et hover
Fermé
Dfordanger
Messages postés
7
Date d'inscription
mardi 1 mars 2011
Statut
Membre
Dernière intervention
30 juin 2014
-
8 mars 2012 à 15:54
Profil bloqué - 28 mars 2013 à 10:13
Profil bloqué - 28 mars 2013 à 10:13
A voir également:
- CSS z-index et hover
- Code ascii de a à z - Guide
- Cpu z pc - Télécharger - Informations & Diagnostic
- Index téléphonique - Guide
- Free z - Guide
- Trait css ✓ - Forum CSS
1 réponse
Salut,
Le problème c'est qu'avec position:relative; tu leur dis de se positionner les uns par rapport aux autres donc... ça fait ce que tu décris.
<head>
<title>Demo</title>
<style type="text/css">
.logo {
width:100px; height:100px; margin-top:5px; margin-left:5px; background-color:#123456;
position:fixed; z-index:0; float:left;
}
.logo:hover {
width:200px; height:120px; background-color:#654321;
z-index:1000;
}
</style>
</head>
<body>
<div class="logo">Test1</div>
<div class="logo" style="margin-left:110px;">Test2</div>
<div class="logo" style="margin-left:215px;">Test3</div>
</body>
Le problème c'est qu'avec position:relative; tu leur dis de se positionner les uns par rapport aux autres donc... ça fait ce que tu décris.
<head>
<title>Demo</title>
<style type="text/css">
.logo {
width:100px; height:100px; margin-top:5px; margin-left:5px; background-color:#123456;
position:fixed; z-index:0; float:left;
}
.logo:hover {
width:200px; height:120px; background-color:#654321;
z-index:1000;
}
</style>
</head>
<body>
<div class="logo">Test1</div>
<div class="logo" style="margin-left:110px;">Test2</div>
<div class="logo" style="margin-left:215px;">Test3</div>
</body>