Bonjour,
Je cherche à mettre deux div l'un sur l'autre.
En fait j'ai un tableau et dans un TD de celui-ci j'aimerai mettre 2 div l'un sur l'autre.
Comment faire ?
Merci d'avance
Bonjour,
Je cherche à mettre deux div l'un sur l'autre.
En fait j'ai un tableau et dans un TD de celui-ci j'aimerai mettre 2 div l'un sur l'autre.
Comment faire ?
Merci d'avance
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 #div1{ position:relative; height:100px; width:100px; background:#f00; } #div2{ position:relative; height:100px; width:100px; top:-100px; left:0; background:#00f; }
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 <div id="div1"></div> <div id="div2"></div>
Merci, j'ai essayé mais j'ai encore un problème, en appliquant le style à mes deux div, ils sont bien l'un sur l'autre mais sous mes div j'ai un espace qui ne devrait pas être présent.
Voici mon code :
En fait lorsque j'ai mes deux div dans ma cellule celle-ci augmente de taille et ne fait plus 106px de hauteur.
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 <table> <tr> <td> <table width="120" height="125" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="118" height="106"> <div style="position:relative;width:118px;height:106px;"> <img src="../images/produits/20061115154827.jpg" /> </div> <div style="position:relative;width:118px;top:-106px;left:0;height:106px;"> <img src="../images/promos/20061115161357.gif" /> </div> </td> <td width="2" rowspan="3"><table width="2" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/omb_coinH.gif" alt="ombh" width="2" height="2" /></td> </tr> <tr> <td><img src="images/pdt_omb_vert.gif" alt="ombv" width="2" height="121" /></td> </tr> <tr> <td><img src="images/omb_coinD.gif" alt="omb" width="2" height="2" /></td> </tr> </table> </td> </tr> <tr> <td width="118" height="17" align="center" valign="middle" bgcolor="#D1D2D2" class="prix"><span class="prixPromo">40,00 €</span> 25,00 €</td> </tr> <tr> <td width="118" height="2"> <table width="118" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="3" height="2"><img src="images/omb_coinG.gif" alt="ombg" width="3" height="2" /></td> <td width="115" height="2"><img src="images/pdt_omb_hor.gif" alt="ombho" width="115" height="2" /></td> </tr> </table> </td> </tr> </table>
Merci par avance de votre aide.
Fais comme ça alors dans ton td :
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <div style="position:relative"> <div style="position:relative;width:118px;height:106px;"> <img src="tonimage" /> </div> <div style="position:absolute;width:118px;top:0;left:0;height:106px"> <img src="tonimage2" /> </div> </div>
Partager