bonjour
je n'arrive a centrer l'image en fonction de la taille de l'écran et le sortir du parent
hmtl
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <div class="contbasem_DG"> <table class="acha" > <tr> <th class="acha" >Image actuelle pour votre article </th> <td class="acha centre"> <a class="loupimaj"><img src="./style/images/shop/<?php echo $logo ?>" alt="<?php echo $logo ?>" width="120" height="120" /> <span style="background-image: url(./style/images/shop/<?php echo $logo ?>)"></span> </a> </td> </tr> </table> </div>
Code css : 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
24
25 .contbasem_DG { width:100%; padding: 10px; border-top: 0; background-color:#fff; text-align:center; } .loupimaj span { position:absolute; height:30%; width:30%; box-shadow:0 0 2px rgba(0,0,0,.5); transform:scale(0) rotate(-12deg); transition:all .25s; opacity:0; background-size: cover; background-position: center; } .loupimaj:hover span, .loupimaj:focus span{ transform:scale(1) rotate(0); opacity:1; cursor:none; z-index:2; }
en faisant ça .loupimaj:hover span ~ .contbasem_DG = je ne vois plus l'image au passage du hover.
j'ai toujours un problème de compréhension avec le ~ ( le parent c'est bien contbasem_DG donc l'image doit être centrer par rapport à lui.)
Partager