Zitat:
Oder muß ich das ganze dann anders als mit float:left lösen?
|
[float: left;] bedeutet nun mal das alles was vom Platz her noch passt ge'floatet' wird.
Wenn ich Dich nun richtig verstanden habe - willst Du nur eine betimmte Anzahl Elemente 'floaten' lassen.
Möglichkeiten
1. Einen übergeordenten Container der die max. Breite bestimmt.
2. Einen
[clear: left;] entsprechend einfügen
hier ein kompiniertes Beispiel, wobei die max. Breite des übergeordenten Containers vom BODY, mit entsprechender Fensterbreite - also variabel, darstellt wird.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//DE" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head><title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
html,body {
padding: 0px;
margin: 0px;
font-family: "Trebuchet MS",Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 100.01%;
background-color: #FF9911;
color: #000000;
}
div {
float: left;
width: 100px;
margin: 5px;
border: 1px solid #000000;
padding: 2px 5px;
background-color: #FFFFFF;
font-size: 0.8em;
}
br.clear {
clear: both;
line-height: 0em;
height: 0px;
}
-->
</style>
</head>
<body>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div><br class="clear" />
<div>[float: left;]</div><br class="clear" />
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
<div>[float: left;]</div>
</body></html>
Ich hoffe es hilft Dir