Alexander22: <div> nimmt nicht den ganzen <td>-platz ein

Beitrag lesen

Hallo zusammen!

Sitze seit einigen Stunden an einem CSS/HTML-Problem und komme überhaupt nicht weiter. Das Problem ist, das im folgenden Code das <div> nicht den gesamten Platz des <td>s einimmt, obwohl das, meiner Meinung nach, so sein sollte.

Ich habe schon dem <div> ein margin:0 und dem <td> ein padding:0 gegeben , aber es bringt nichts.

Das einzige was wirkt, aber meiner Meinung nach unlogisch ist, ist dem <p> ein "margin-top:0;" zu geben. Dann schiebt es sich auch das <div> mit nach oben. Eigentlich sollte es ja auch nur bis zum <div> hochgehen,  also zum Elternelement.

Hat jemand eine Idee woran das liegt? Irgendwie sieht das nach einem Bug aus.

Grüße

Alexander

Der Code:

<?XML VERSION="1.0" ENCODING="iso-8859-1" ?>
<!doctype HTML public "-//w3c//dtd xhtml 1.0 tRANSITIONAL//en"
"HTTP://WWW.W3.ORG/tr/XHTML1/dtd/XHTML1-TRANSITIONAL.DTD">
<HTML XMLNS="HTTP://WWW.W3.ORG/1999/XHTML">
<HEAD>
</HEAD>
<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" STYLE="">
        <TR>
                <TD STYLE="BACKGROUND-COLOR:BLACK;PADDING:0;">
                        <DIV STYLE="BACKGROUND-COLOR:RED;MARGIN:0;">
                                <p style="margin-top:0;">gganz viel text ganz viel text ganz viel text gganz viel text anz viel text ggggggggggggggggganz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text anz viel text .i
                                </p>
                        </div>
                </td>
        </tr>
</table>

</body>
</HTML>