|
Probleme mit CSS Ausrichtung
Hallo, meine Website besteht aus einem Maincontent div, der 3 div container enthält:#
Linke Seite: Contentbereich, darunter Block mit fester Größe, beide divs mit identischer Breite
Rechte Seite: Sidebar, deren Höhe der des Contents plus des Blocks entsprechen soll.
Diese 3 divs stellen den Hauptinhalt dar, befinden sich also im maincontent div (alle gefloatet)
Momentan habe ich folgende CSS Probleme:
1) Die Sidebar rechts schließt unten nicht ab, dh sie ist nur so lang wie das "content" div
2) Ich weiß nicht wie ich das div links unten am unteren rand fixiert, während der content bereich noch flexibel bleiben soll (dh bei längeren texten sich automatisch anpasst)
Für Hilfe bin ich sehr dankbar!
Gruß
Stefan
Quelltext:
head:
#sidebar {
float: right; /* since this element is floated, a width must be given */
width: 150px;
height: 50%; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px;
}
#content{
float: left; /* since this element is floated, a width must be given */
width: 565px;
/* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #cb001d; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px;
}
#block{
float: left; /* since this element is floated, a width must be given */
width: 565px;
height: 100px;
/* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #243C49; /* the background color will be displayed for the length of the content in the column, but no further */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
left: 47px;
top: -38px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style>
HTML
<div id="mainContent">
<div id="sidebar"></div>
<div id="content"></div>
<div id="block"></div>
</div>
</div><br class="clearfloat" />
<!-- end #container --></div>
Geändert von Rieglicky (30.01.2008 um 05:22 Uhr).
|