• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

finde meinen Fehler beim Floaten nicht?

Corraggiouno

Mitglied
hi,

kann mir jemand bei meinem float-fehler helfen.
html-code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Christian r</title>
<link href="css/cm.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">
<h1>Praxis für ganzheitliche Heilkunde</h1>
<div id="nav">

 <ul>
  <li class="activebig"><a href="home.php">Home</a></li>
  <li><a href="praxis.php" class="dashbig">Praxis</a></li>
  <li><a href="therapie.php" class="dashbig">Therapie</a>
   <ul>
    <li><a href="peet.php" class="dashsmall">Physio emotionelle energetische Therapie</a></li>
    <li><a href="enmt.php" class="dashsmall">Ernährungsberatung nach Metabolic Typing</a></li>
    <li><a href="tcm.php" class="dashsmall">Traditionelle chinesische Medizin</a></li>
    <li><a href="ap.php" class="dashsmall">Akupunktur</a></li>
   </ul>
   </li>
  <li><a href="kontaktformular.php" class="dashbig">Kontaktformular</a></li>
 </ul>
</div>
<div id="maintext">
hier wird der Inhalt von Home sein
</div>
<div id="footer">
<a href="impressum.php">Impressum</a> | <a href="kontakt.php">Kontakt</a>
</div>
</body>
</html>

css-code:
Code:
html {
height: 100.3%;
}

body{
font-family: Verdana, sans-serif;
font-size:0.8em;
color: #000000;
}

* {
margin: 0;
padding: 0;
}

div#wrapper {
width: 900px;
margin:20px auto;

border-style:solid;
border-color:#0000000;
border-width:1px;

}


h1 {
background: url(../images/logo.gif) no-repeat center;
height:206px;
text-indent: -999em;
}


div#nav {
float:left;
background:url(../images/nav.gif) repeat-y;
width:225px;
margin-left:10px;
height: 400px;
color:#ae262c;
}

ul {
padding-left:40px;
list-style-type:none;

}

ul ul {
font-size:0.7em;
padding-left:12px;
}

li {
padding-top:20px;
}

div#nav a {
text-decoration: none;
color:#ae262c;
display: block;
padding-left: 18px;
}

div#nav a.dashbig:link {
background:url(../images/dashbig_yellow.gif) no-repeat;	
background-position:0 2px;
color:#ae262c;
}
div#nav a.dashbig:visited {
background:url(../images/dashbig_yellow.gif) no-repeat;	
background-position: 0 2px; 
color:#ae262c;
}

div#nav a.dashbig:hover {
background:url(../images/dashbig_red.gif) no-repeat;	
background-position: 0 2px; 
color:#ae262c;
}


div#nav a.dashsmall:link {
background:url(../images/dashsmall_yellow.gif) no-repeat;	
background-position:3px 3px;
color:#ae262c;
}
div#nav a.dashsmall:visited {
background:url(../images/dashsmall_yellow.gif) no-repeat;	
background-position:3px 3px; 
color:#ae262c;
}

div#nav a.dashsmall:hover {
background:url(../images/dashsmall_red.gif) no-repeat;	
background-position:3px 3px; 
color:#ae262c;
}

.activebig {
background: url(../images/dashbig_red.gif) no-repeat 0 22px;
}

.activesmall{
background: url(../images/dashsmall_red.gif) no-repeat 3px 23px;
}

div#footer{
clear:left;
background: url(../images/footer.gif) no-repeat;
width:225px;
height:60px;
margin-left:10px;
padding-left:40px;
color:#ae262c;
}

div#footer a {
text-decoration:none;
font-size: 0.8em;
color:#ae262c;
text-align:left;
}


div#maintext {
/*background: url(../images/head_maintext.gif) no-repeat;*/

width: 600px;
height:400px;
border-style:solid;
border-width:1px;
border-color:#0000000;

float:left;
margin-top: -25px;
margin-left: 8px;
padding:20px;

}
wie schon auf der seite zu erkennen ist, bildet sich ein abstand zwischen navigation und footer. Warum bildet sich ein Abstand wenn ich im maintext-container die Höhe dementsprechend verändere? Ich habe doch richtig gefloatet, oder?
 
Ohne Link zur Seite erkenne ich überhaupt nichts. Ich bin nicht gewillt, mir Code lokal abzuspreichern um helfen zu können.

Gruß thuemmy
 
habe meinen Fehler gefunden. Ich habe jetzt meinen div#maintext rechts floaten lassen.
Dann sieht es gut aus. Christian r
.......aber warum wird ein Abstand zwischen der Navigation und dem footer gebildet, wenn ich den div#maintext links floaten lasse? Das erscheint mir nicht ganz logisch? - siehe Anlage -
 

Anhänge

  • abstand.gif
    abstand.gif
    18 KB · Aufrufe: 5
habe meinen Fehler gefunden. Ich habe jetzt meinen div#maintext rechts floaten lassen.
Dann sieht es gut aus. Christian r
.......aber warum wird ein Abstand zwischen der Navigation und dem footer gebildet, wenn ich den div#maintext links floaten lasse? Das erscheint mir nicht ganz logisch? - siehe Anlage -

weil er nach dem <div id="maintext"> kommt und clear:left; hat

Grüße
Bernhard
 
Zurück
Oben