ERLEDIGT
JA
JA
ANTWORTEN
2
2
ZUGRIFFE
236
236
EMPFEHLEN
-
30.05.10 15:39 #1Marico Tutorials.de Gastzugang
Hallo,
ich habe folgendes Problem:
Ich habe ein Div in diesem sollen sich links, nebeneinander drei weitere befinden. Anschließenssoll eine "Lücke" mit variabler Größe folgen (ob freier Platz oder ein weiteres Div ist egal). Ein letztes Div soll am rechten Rand des Übergeordneten sein.
Per float kann ich die Divs zwar nebeneinander anordnen allerdings nur mir einer festen Breite...
Gibt es eine Möglichkeit das ganze wie oben beschrieben darzustellen?
zur Veranschaulichung:
mit 6 Divs:
[head_top (übergeordnetes Div)
[left][logo][middle][repeat (mit variabler Größe)][right]
]
mit 5 Divs
[head_top (übergeordnetes Div)
[left][logo][middle] [right (rechts positioniert)]
]
der code:
HTML-Code:<!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> <link rel="stylesheet" type="text/css" href="css/layout.css" /> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> </head> <body> <div id="container"> <div id="head_top"> <div id="head_top_left" /> <div id="head_top_logo" /> <div id="head_top_middle" /> <div id="head_top_right" /> </div> </div> </body> </html>
Code css:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#container { background-color: #000000; width: 85%; min-width: 800px; margin: auto; margin-top: 20px; margin-bottom: 20px; } #head_top { background-color: #ffffff; width: 90%; min-width: 780px; height: 30px; margin: auto; } #head_top_left { background-color: blue; width: 6px; height: 30px; float: left; } #head_top_logo { background-color: red; width: 144px; height: 30px; margin-left: 6px; float: left; } #head_top_middle { background-color: green; width: 2px; height: 30px; margin-left: 144px; float: left; } #head_top_right { background-color: grey; width: 6px; height: 30px; margin-left: 2px; }
Geändert von Maik (30.05.10 um 15:53 Uhr) Grund: Quellcode in Syntaxhighlighter eingebunden
-
30.05.10 15:52 #2Maik Tutorials.de Gastzugang
Hi,
dein Vorhaben setzt du folgendermaßen um:
Neu lautende Regeln für diese beiden Blöcke:HTML-Code:<div id="container"> <div id="head_top"> <div id="head_top_left"></div> <div id="head_top_logo"></div> <div id="head_top_right"></div> <div id="head_top_middle"></div><!-- Der DIV-Block mit der variablen Breite wird innerhalb des Markups der zu umfliessenden Blöcke an letzter Stelle genannt --> </div> </div>
Code css:1 2 3 4 5 6 7 8 9 10 11 12 13
#head_top_middle { background-color: green; height: 30px; margin-left: 156px; /* linker Außenabstand zu den beiden linken vorangegangenen Blöcken */ margin-right: 6px; /* rechter Außenabstand zum rechten Block */ } #head_top_right { background-color: gray; /* Der Farbname wird mit "a" geschrieben */ width: 6px; height: 30px; margin-left: 2px; float: right; /* Element soll vom nachfolgenden Block linksseitig umflossen werden, und richtet sich am rechten Rand aus */ }
mfg Maik
-
30.05.10 16:16 #3Marico Tutorials.de Gastzugang
Vielen Dank für die schnelle Hilfe.
lG Marico
Ähnliche Themen
-
Anordnung von DIVs und Text-Ausrichtung
Von Muckel1986 im Forum CSSAntworten: 8Letzter Beitrag: 28.08.10, 01:13 -
Ausrichtung innerer <DIVS>
Von Transporter im Forum CSSAntworten: 2Letzter Beitrag: 20.03.08, 11:41 -
2 DIVs nebeneinander innerhalb eines Haupt-DIVs
Von Eiszwerg im Forum CSSAntworten: 10Letzter Beitrag: 21.03.07, 13:33 -
Draggable divs - Positionen versch. divs speichern
Von Tapir im Forum Javascript & AjaxAntworten: 3Letzter Beitrag: 18.03.07, 11:14 -
Ausrichtung innerhalb eines divs
Von Moan im Forum CSSAntworten: 2Letzter Beitrag: 29.12.05, 13:06





Zitieren
Login





