Problem mit Css

Hallo liebe Forum-User,

ich habe ein Problem mit CSS. Es geht darum, ich habe eine div-box mit dem Namen „main“. Diese ist 900px breit. In der „main-box“ sind alle anderen div-boxen untergebracht z.B. Navi und Content. Mein Problem ist: Ich möchte dass die Höhe der main-box automatisch ist, je nach Inhalt.

Ich hab schon .main {height:auto;} probiert, klappt aber nicht.

hallo Marvbay

meine Kochensteine die ich anstelle des „Quellcodes oder eines Link zu deiner Seite“ befragen musste haben mir gesagt das es vielleicht mit der float: Eigenschaft zutun hat und du kein clear: verwendest. Aber meine Ferndiagnose war noch nie so recht gut !

Cu Stefan

Bin noch Anänger :wink:

CSS-Code:

body
{
background-image:url(images/background.jpg);
}

.main
{
width:900px;
margin:auto;
background-color:#00FF00;
padding: 20px;

}

.header
{
width:900px;
height:150px;
background-color:#00FF00;
float:left;
}

.navi
{
width:15%;
height: 300px;
float:left;
font-family: Times New Roman;
font-size:16pt;
margin-top:20px;
color:#000000;

}

.home
{
width:100%;
height:25%;
border-top: 1px solid;
float:left;
margin-top:5px;

}

.news
{
width:100%;
height:25%;
border-top: 1px solid;
float:left;
}

.bilder
{
width:100%;
height:25%;
border-top: 1px solid;
float:left;
}

.kontakt
{
width:100%;
height:25%;
border-top: 1px solid;
float:left;

}

.content
{
width:70%;
padding:5px;
min-height:500px;
float:left;
background-repeat:repeat-y;
font-family:Arial;
font-size:9pt;
margin-top: 20px;
margin-left: 5px;
background-image:url(images/background-content.jpg);

}

.links
{
width:13%;
height:300px;
float:left;
margin-top: 20px;
}

A:hover
{
color:#FFFFFF;
font-size:18pt;
}

a:link
{
text-decoration:none;
}

a:active
{
text-decoration:none;
}

a:visited
{
text-decoration:none;

}

HTML-Code:

HOME

NEWS

BILDER

KONTAKT

KONTAKT

Hallo

du musst navi, countent und links in ein gemeinsames Div legen welches die Eigenschaft

overflow: auto;

hat.

cu stefan

Vielen, vielen Dank!!! :smile:

Servus marvboy,

habe da noch was recht Interessantes gefunden:

http://www.positioniseverything.net/ordered-borders-…

cu Stefan