ERLEDIGT
JA
JA
ANTWORTEN
3
3
ZUGRIFFE
3019
3019
EMPFEHLEN
-
Hallo,
ich möchte in zwei Bereiche, einen Textbereich und einen Bereich mit einem Bild nebeneinander positioniern. Dabei wollte ich die Bereiche mit float positionieren. Dabei sollten die beiden Bereiche von der Höhe her gleich sein, auch wenn der Textbereich mit viel Text höher wird, als der Bereich mit dem Bild.
Die beiden Bereich sollen eine Hintergrundfarbe bekommen. Zwischen den Bereichen soll ein Abstand von ungefähr 2 pixeln sein. Das Bild im rechten Bereich hat immer die gleiche größe und ist kleiner als der Bereich selber.
Kann ich das mit float erreichen und wie kann ich das ganze erreichen.
Gruss
JulinusGeändert von julchen (21.11.06 um 14:33 Uhr)
-
21.11.06 14:34 #2
Du müsstest um die beiden Bereiche einen div-Container tun und in diesem div die Hintergrudngrafik, welche für deinen text & Bildbereich jeweils die Hintergrundgrafik hat (mit repeat-y). Dann können die Bereiche unterschiedlich hoch sein, sehen aber gleich hoch aus.
Gruß RadhadMein neues Projekt: zandman.de - Bericht über den Aufbau einer Entwicklungsumgebung für Test-Driven-Development mit phpUnderControl und dem Aufbau einer Webapplikation mit Zend Framework Version 1.9.x
-
Hallo,
vielen Dank, das hab ich soweit hinbekommen. Allerdings positioniert er mir die beiden Blöcke nicht nebeneinander.
Wo liegt der Fehler?
Hier ein Auszug:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<div id="content_block"> <p class="content_block_left"> <h2 class="content_block_title">Leistungsspektrum</h2> <ul id="content_block_liste"> <li><strong>Einfamilienhaus</strong> in Holzrahmenbauweise</li> <li><strong>Anbauten</strong></li> <li><strong>Aufstockungen</strong></li> <li><strong>Brückenbau</strong></li> <li><strong>Carports</strong></li> <li><strong>Gewerbebau</strong></li> <li>hochkomplexe <strong>Dachbauten</strong>.</li> </ul> </p> <p class="content_block_right"> test </p> </div>
CSS Auszug:
Code :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
#content_block{ width:578px; background-image:url(../images/bg_content_block.gif); background-repeat:repeat-y; } .content_block_right{ width:200px; color:#000; } .content_block_left{ width:350px; color:#000; margin-left:10px; float:left; } .content_block_title{ color:#fff; padding-left:10px; font-size:12px; font-weight:bold; } h2.content_block_title{ color:#fff; padding-left:10px; font-size:12px; font-weight:bold; } #content_block_liste{ padding-left:10px; margin-left:20px; list-style-position:outside; list-style-image:url(../images/arrow_liste.gif); } #content_block_liste li{ line-height:10px; margin-top:5px; padding-bottom:5px; }
Gruss
Julchen
-
21.11.06 16:43 #4Maik Tutorials.de Gastzugang
Lösungsvorschlag:
Und die p-Elemente durch div-Elemente ersetzen:Code :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 42 43
#content_block{ width:578px; background-image:url(../images/bg_content_block.gif); background-repeat:repeat-y; } .content_block_right{ width:200px; color:#000; [b]float:right;[/b] } .content_block_left{ width:350px; color:#000; margin-left:10px; float:left; } .content_block_title{ color:#fff; padding-left:10px; font-size:12px; font-weight:bold; } h2.content_block_title{ color:#fff; padding-left:10px; font-size:12px; font-weight:bold; } #content_block_liste{ padding-left:10px; margin-left:20px; list-style-position:outside; list-style-image:url(../images/arrow_liste.gif); } #content_block_liste li{ line-height:10px; margin-top:5px; padding-bottom:5px; } [b]div.clear { clear: both; font-size: 1px; }[/b]
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<div id="content_block"> <div class="content_block_left"> <h2 class="content_block_title">Leistungsspektrum</h2> <ul id="content_block_liste"> <li><strong>Einfamilienhaus</strong> in Holzrahmenbauweise</li> <li><strong>Anbauten</strong></li> <li><strong>Aufstockungen</strong></li> <li><strong>Brückenbau</strong></li> <li><strong>Carports</strong></li> <li><strong>Gewerbebau</strong></li> <li>hochkomplexe <strong>Dachbauten</strong>.</li> </ul> </div> <div class="content_block_right"> test </div> [b]<div class="clear"> </div>[/b] </div>
Ähnliche Themen
-
Zwei Divs nebeneinander mit gleicher Höhe
Von NgiseD im Forum CSSAntworten: 1Letzter Beitrag: 11.10.09, 19:47 -
Zwei DIV-Boxen nebeneinander mit gleicher aber variabler Höhe
Von Shen84 im Forum CSSAntworten: 1Letzter Beitrag: 29.03.09, 17:50 -
Zwei Absätze nebeneinander positionieren
Von chaosente im Forum CSSAntworten: 5Letzter Beitrag: 06.06.07, 06:06 -
Exakte Höhe eines DIV-Blocks im IE
Von Issy im Forum CSSAntworten: 5Letzter Beitrag: 03.05.06, 15:13 -
Zwei divs nebeneinander positionieren
Von messmar im Forum CSSAntworten: 11Letzter Beitrag: 30.06.05, 18:13





Login





