Hallo,
ich habe hier folgenden Beispielcode:
Das "kleine" div ("topleft") sollte laut Selfhtml oben links in der Tabelle erscheinen, weil die als nächsthöheres Element nicht "static" platziert ist. Aber Firefox scheint wohl "<body>" / "<html>" vorzuziehen. Mache ich einen Denkfehler? Opera, Konqueror und IE(!!!) zeigen es so an. Kann das wirklich sein, macht der Browser aller Browser in Sachen W3C einen Fehler?
//edit: Und warum kann man Elemente nicht nur mit left, right, top, bottom positionieren? Beispiel:
Dann ist bei mir links obenein kleines Rechteck, außer im Opera da ein Streifen bis unten hin, hat wohl "bottom" noch berücksichtigt.
ich habe hier folgenden Beispielcode:
HTML-Code:
<html> <head> <style> table#thetable { position: absolute; left: 10%; top: 10%; width: 80%; height: 60%; empty-cells: show; } div#topleft { position: absolute; left: 3px; height: 20px; width: 20px; top: 3px; background: yellow; } </style> </head> <body> <table border="1" cellpadding="0" cellspacing="0" id="thetable"> <tr height="24"> <td width="7"></td> <td align="center">Hallo</td> <td width="7"></td> </tr> <tr> <td colspan="3"> <div id="topleft"></div> </td> </tr> </table> </body> </html>
//edit: Und warum kann man Elemente nicht nur mit left, right, top, bottom positionieren? Beispiel:
HTML-Code:
<style> table#thetable { position: absolute; left: 0; right: 0; top: 0; bottom: 0; } </style>
Kommentar