|
|||
div automatische Breite
hi!
Ich habe einen Container, in dem drei DIV's horizontal positioniert sind. Das linke div hat 50px, das rechte 150px breite. Wie bekomme ich das mittlere auf die "Restbreite"? Muss ich die px zählen oder geht das automatisiert? auszug aus dem code Code:
.links { float: left; width:50px } .mitte { float: left; } .rechts { float: right; width:150px } Code:
<div> <div class="links>links</div> <div class="mitte>mitte</div> <div class="rechts>rechts</div> </div> greets! |
Sponsored Links |
|
|||
Ich glaube, da musst du zählen, oder du greifst auf Javascript zurück, was dir das dynamisch abnimmt...
Kann mich aber auch irren, mir war so, als ob es da noch ein Workaround gab, bin mir aber auch grad nicht sicher.
__________________
jQuery Board - Das deutsche jQuery Forum |
Sponsored Links |
|
|||
Vieleicht so auf die Schnelle,
mit Hilfe von position, Beispiel: Code:
html, body, div { margin: 0; padding: 0; } } #container { position: relative; } .links { width: 50px; position: absolute; top: 0; left: 0; } .mitte { margin: 0px 150px 0px 50px; } .rechts { width: 150px; position: absolute; top: 0; right: 0; } HTML-Code:
<div id="container"> <div class="links">... </div> <div class="rechts">... </div> <div class="mitte">... </div> </div> ____________ Gruß, Roland |
|
|||
Probier doch mal den YAML Builder aus, damit bekommt man das hin und auch den entsprechenden Quellcode: YAML Builder | A tool for visual development of YAML based CSS layouts
Frank |
|
|||
Ich würde die Mitte als eine Art Wrapper benutzen, diesen auf 100% Breite stellen und innerhalb dieses Wrappers den linken und rechten Bereich auf den entsprechenden Seiten floaten lassen.
Code:
div.mitte { width:100%; background:lightgreen; } div.mitte div.links { width:50px; float:left; background:yellow; } div.mitte div.rechts { width:150px; float:right; background:red; } HTML-Code:
<div class="mitte"> <div class="links"> links </div> mitte <div class="rechts"> rechts </div> </div> |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Brauche Hilfe: Schwarzes Nichts | Zwox | CSS | 10 | 19.11.2010 16:53 |
div breite im IE und Chrome | emmis | CSS | 2 | 11.10.2010 18:05 |
DIV Breite dyn. je nach Inhalt, umgebendes DIV aber fest | PatrickS | CSS | 2 | 17.12.2009 12:06 |
Breite Div Links/rechts automatisch auffüllen mit Textur | BiBaButzemann | CSS | 9 | 06.02.2009 11:42 |
div Breite nicht kleiner als Inhalt | DcK | CSS | 0 | 18.11.2006 14:44 |