[CSS/HTML] Supprimer des marges entre images

Résolu/Fermé
Kopros Messages postés 597 Date d'inscription mardi 25 septembre 2007 Statut Membre Dernière intervention 3 février 2020 - 20 nov. 2008 à 15:14
Kopros Messages postés 597 Date d'inscription mardi 25 septembre 2007 Statut Membre Dernière intervention 3 février 2020 - 21 nov. 2008 à 10:35
Bonjour à tous,

Dans une page html (qui fait appel à du css) j'ai un header composé de 3 images qui, collées les unes aux autres, doit faire une grande image.
J'ai testé toutes les solutions que j'ai trouvées sur le net, mais il reste une marge qui sépare les images.

Je ne trouve pas d'autre solution, c'est pourquoi je sollicite votre aide.

Voici mon code html :

<div class="header">
<table border="0px" cellspacing="0px" marginwidth="0px" marginheigth="0px" margin-left="0px" margin-top="0px"><tr>
<td><div id="hg"></div></td><td><div id="hm"><div id="ban"></div></div></td><td><div id="hd"></div></td>
</tr></table>

</div>


et le css :


.header

{

margin: auto;
padding: 0px;

width: 762px;
background-position:center;
z-index:0;

}

div#hg
{
z-index:0;
background-image:url(images/haut-gauche.bmp);
background-position:center;
background-repeat: no-repeat;
width: 203px;
height: 113px;
padding : 0px;
margin : 0px;
}
div#ban
{
background-image : url(images/ban-razta.gif);
position:absolute;
top:34px;
z-index:1;
background-position:center;
background-repeat: no-repeat;
width: 467px;
height: 58px;
padding: 0;
margin: 0;
}
div#hm
{
background-image : url(images/haut-milieu.bmp);
z-index:0;
background-position:center;
background-repeat: no-repeat;
width: 468px;
height: 113px;
padding: 0;
margin: 0;
}
div#hd
{
background-image : url(images/haut-droit.bmp);
z-index:0;
background-position:center;
background-repeat: no-repeat;
width: 79px;
height: 113px;
padding: 0;
margin: 0;
}


Avez-vous une idée pour supprimer la marge ?

Je sait qu'elle est due au tableau, car lorsque je mets les images sans tableau tout va bien. Le soucis, s'il n'y a pas le tableau, c'est que le header est décalé par rapport au bg du contenu.

Voici le html du contenu (une div tout con) :
<div class="content">
</div>

et le css :

.content

{
padding: 0px;

padding-top: 100px;

padding-bottom: 200px;

width: 762 px;

margin: auto;

background-image:url(images/bg.bmp);

background-repeat:repeat-y;

background-position:center;
z-index:0;
}

donc là, quand on enlève le tableau du header, il y a un décalage entre le content et le header, et je ne comprends pas pourquoi.
Merci de votre aide
A voir également:

2 réponses

Kopros Messages postés 597 Date d'inscription mardi 25 septembre 2007 Statut Membre Dernière intervention 3 février 2020 89
21 nov. 2008 à 10:35
Excellent ça fonctionne ! :-)

J'avais juste oublié le cellpadding.

Merci bien Olgark.
2
Essaie ce qui suit :

<table border="0px" cellspacing="0px" marginwidth="0px" marginheigth="0px" margin-left="0px" margin-top="0px">

A remplacer par

<table border="0px" cellspacing="0px" cellpadding="0px" marginwidth="0px" marginheigth="0px" margin-left="0px" margin-top="0px">
-1