|
|||
Hilfe beim Clearen gesucht!
Hallo Leute..
ich verzweifel gleich. Ich bekomme es einfach nicht hin, dass folgender Code gescheit gecleared wird. Ich habe einen Container-Div und bastel mit PHP in diesem Container eine Tabelle aus divs. Die Tabelle wächst dabei über den Container heraus. Hier mal die CSS: HTML-Code:
#container { background-color:#FFFFFF; margin-left:20px; margin-top:20px; width:550px; padding:10px; padding-top:0px; left:190px; font-size:12px; position:absolute; } // Ein gefärbte Balken, in den durch .shop_cell die Titel reinkommen #table_header { background-color:#FFD594; height:25px; } // Jede Zelle der Tabelle .table_cell { font-weight:bold; height: 15px; padding: 5px; float:left; } HTML-Code:
<div id="right"> <h2>. . : : Online-Store : : . .</h2> <div> <div id='table_header'> <div class='table_cell' style='width:130px;'>Produkt</div> <div class='table_cell' style='width:300px;'>Download</div> <div class='table_cell' style='width:75px;'>Preis</div> </div> <div> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px;'>...</div> </div> <div> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px;'>...</div> </div> </div> </div> |
Sponsored Links |
|
|||
Das Stichwort, das du suchst, heißt "Containing Floats" -- siehe FAQ Punkt 2.
Aber lies bitte unbedingt diesen Artikel. Ich habe den Eindruck, dass du dem Missverständnis aufgesessen bist, Tabellen seien grundsätzlich "böse". Und lies bitte die Hinweise für Fragende. Codefragmente genügen nicht.
__________________
Corina Rudel Online-Einsteigerkurs HTML/CSS | Buch: Fortgeschrittene CSS-Techniken |
Sponsored Links |
|
|||
Vielen Dank für die Antwort.
Ja, ich vermeide Tabellen wo ich kann Ähm, ich weiß ja, dass ich clearen muss, aber kein clear funktioniert - und - der Fehler tritt AUCH im Internet Explorer auf. Soll ich da lieber eine Tabelle nehmen, oder weiter nach der Lösung suchen? Danke |
|
|||
Ja, dein Konstrukt ist Unfug. Das ist die Kurzfassung des von mir verlinkten Artikels, den du ganz offensichtlich nicht gelesen hast.
Wenn etwas nicht funktioniert, musst du zeigen, was du machst. In deinen Codeschnipseln gibt es nicht einmal den Versuch eines Clears. Bevor du jetzt das nächste Posting abschickst, lies bitte alle von mir geposteten Links. Sonst hat das hier alles keinen Sinn.
__________________
Corina Rudel Online-Einsteigerkurs HTML/CSS | Buch: Fortgeschrittene CSS-Techniken |
|
|||
Die Artikel habe ich gelesen. Habe ich, bevor ich mich hier registriert habe, mehrere Artikel gelesen.
Es hieß immer, dass nach den gefloateten Elementen immer ein clear folgen muss. Der Fehler würde beim IE allerdings nicht auftreten, da dieser es wohl automatisch macht. Der Fehler tritt trotzdem auf. Hier nochmal mit meinen Clears: (eine URL kann ich nicht geben, da ich lokal arbeite) HTML-Code:
<div id="right"> <h2>. . : : Online-Store : : . .</h2> <div> <div id='table_header'> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px;'>...</div> <div style='clear:left;'></div> </div> <div> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px;'>...</div> <div style='clear:left;'></div> </div> <div> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px;'>...</div> <div style='clear:left;'></div> </div> </div> </div> |
|
|||
__________________
Corina Rudel Online-Einsteigerkurs HTML/CSS | Buch: Fortgeschrittene CSS-Techniken |
|
||||
Also ich habs noch mit EasyClearing ausprobiert und ich weiss nicht, aber bei mir klappts damit oder ich seh dein Problem einfach nicht. Mach doch mal ein Printscreen.
HTML-Code:
<div class="clearfix" id="container"> <h2>. . : : Online-Store : : . .</h2> <div class="clearfix"> <div class="clearfix" id="table_header"> <div class='table_cell' style='width:130px;'>Produkt</div> <div class='table_cell' style='width:300px;'>Download</div> <div class='table_cell' style='width:75px; float:left'>Preis</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> <div class="clearfix"> <div class='table_cell' style='width:130px;'>...</div> <div class='table_cell' style='width:300px;'>...</div> <div class='table_cell' style='width:75px; float:left'>...</div> </div> </div> </div> Code:
#container { background-color:#FFFFFF; margin-left:20px; margin-top:20px; width:550px; padding:10px; padding-top:0px; left:190px; font-size:12px; position:absolute; border: 1px solid; } /* Ein gefärbte Balken, in den durch .shop_cell die Titel reinkommen */ #table_header { background-color:#FFD594; height:25px; } /* Jede Zelle der Tabelle */ .table_cell { font-weight:bold; height: 15px; float:left; } .clearfix:after { content: "."; display: block; clear: both; height: 0; visibility: hidden; } /* IE-Patches für Clearfix */ .clearfix { display: inline-block; } /* Vor IE5/Mac verstecken mit dem Commented Backslash Hack \*/ * html .clearfix { height: 1px; } .clearfix { display: block; } /* Ende des Versteckspiels für den IE5/Mac */ Printscreen Geändert von sphere (28.04.2009 um 19:35 Uhr) |
Sponsored Links |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Hilfe gesucht beim erstellen meiner Startseite..... | eBase2009 | CSS | 17 | 25.06.2009 22:07 |
Hilfe gesucht...! | Indy | CSS | 8 | 27.01.2009 23:34 |
Hilfe bei Parallelschaltung gesucht | Muckel | Offtopic | 6 | 03.07.2008 15:45 |
Hilfe gesucht? | chris07 | CSS | 8 | 09.08.2006 14:30 |
CSS Hilfe gesucht für Blindenseite | johnjdoe | CSS | 30 | 17.02.2005 17:14 |