Probleme de CSS

Par Ty Malib, il y a 7 ans


Les bases HTML/CSS

Bonsoir, alors voila j'ai un soucis avec mon CSS, mon objectif coller mes <td> sauf qu'il garde 4px en bas... J'ia inspecté l'element pour trouver une erreur mais je n'ai pas trouvé comment la corriger. C'est en inspectant que j'ai vu la marge de 4px. 40px44px au lieu de 40px40px.

Voici mon code html et voici mon code css

https://codeshare.io/29ZbwB

voici une image du rendu

https://zupimages.net/up/18/37/th1r.png

Si quelqu'un à une idée je suis preneur.
Merci

7 réponses

Ty Malib, il y a 7 ans

Probleme réglé

Lartak, il y a 7 ans

Bonsoir.
Le lien du code que tu fournis ne contient qu'un éditeur vide.

Write or paste code here then share. Anyone you share with will see code as it is typed!

Ty Malib, il y a 7 ans

En effet, je viens de le remettre.

Sinon voici le code ici:

<table class="galaxie_table">
<?php
for($y=YMIN; $y<=YMAX; $y++)
{
echo "<tr>";
for($x=XMIN; $x<=XMAX; $x++)
{
if(isset($element[$y][$x]))
{
$R = $element[$y][$x]['case_numero'];
if( $R == 0)
{
?>

            <form method="POST" action="<?php echo pathPhp(); ?>galaxie/info_case.php">
            <input type="hidden" name="joueur" value="<?php echo $element[$y][$x]['joueur'] ?>"></input>
            <input type="hidden" name="type" value="<?php echo $element[$y][$x]['type'] ?>"></input>
            <input type="hidden" name="coordonnee_spatial" value="<?php echo $element[$y][$x]['coordonnee_spatial'] ?>"></input>
            <input type="hidden" name="numero_systeme" value="<?php echo $element[$y][$x]['numero_systeme'] ?>"></input>
            <td class="carreau_espace"><img src="<?php echo pathImg();?>galaxie/image/<?php echo $element[$y][$x]['image']; ?>"></image></td>
            </form>
            <?php
            }
            elseif($R == 1)
            {
            ?>

            <form method="POST" action="<?php echo pathPhp(); ?>galaxie/info_case.php">
            <input type="hidden" name="joueur" value="<?php echo $element[$y][$x]['joueur'] ?>"></input>
            <input type="hidden" name="type" value="<?php echo $element[$y][$x]['type'] ?>"></input>
            <input type="hidden" name="coordonnee_spatial" value="<?php echo $element[$y][$x]['coordonnee_spatial'] ?>"></input>
            <input type="hidden" name="numero_systeme" value="<?php echo $element[$y][$x]['numero_systeme'] ?>"></input>
            <td class="carreau_planete">
            <img src="<?php echo pathImg();?>galaxie/image/<?php echo $element[$y][$x]['image']; ?>"></image>
            </td>
            </form>
            <?php
                                //<button type="submit" class="invisible">
            }
            elseif( $R == 3)
            {
                ?>
            <form method="POST" action="<?php echo pathPhp(); ?>galaxie/info_case.php">
            <input type="hidden" name="joueur" value="<?php echo $element[$y][$x]['joueur'] ?>"></input>
            <input type="hidden" name="type" value="<?php echo $element[$y][$x]['type'] ?>"></input>
            <input type="hidden" name="coordonnee_spatial" value="<?php echo $element[$y][$x]['coordonnee_spatial'] ?>"></input>
            <input type="hidden" name="numero_systeme" value="<?php echo $element[$y][$x]['numero_systeme'] ?>"></input>
            <td class="carreau_soleil">
            <img src="<?php echo pathImg();?>galaxie/image/<?php echo $element[$y][$x]['image']; ?>"></image>
            </td>
            </form>
            <?php
            }
        }
        else
        {
            // Sert à afficher les cases grises qui ne comportent aucune données
            //violet
            echo '<td class="carreau_soleil ' . $element[$y][$x]['type'] . '"> ' . $element[$y][$x]['soleil'] . '</td>';  
        }
    }
    echo "</tr>";
}

?>
</table>

CSS:

table.galaxie_table
{

width: 640px;
height:640px;
padding-top:120px;
border-collapse: collapse;
border-spacing:0px;

}

.carreau_espace
{

padding: 0;
width:40px;
height:40px;
}
.carreau_planete
{

padding: 0;
width:40px;
height:40px;

}

.carreau_soleil
{

padding: 0;
width:40px;
height:40px;

}

Ty Malib, il y a 7 ans

Mon soucis vient de la balise image, car quand je retire celle-ci et que je met juste un background dans le css tout est bon.

Ty Malib, il y a 7 ans

Encore? pourtant moi j'ai bien le code dedans...

Ty Malib, il y a 7 ans

table.galaxie_table {
width: 640px;
height:640px;
padding-top:120px;
border-collapse: collapse;
border-spacing:0px;
}

.carreau_espace {
padding: 0;
width:40px;
height:40px;
}

.carreau_planete {
padding: 0;
width:40px;
height:40px;
}

.carreau_soleil {
padding: 0;
width:40px;
height:40px;
}