ok scusa per la poca chiarezza, allora se scrivo questo codice:
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Documento senza titolo</title>
<style>
div{
border:1px #000000 solid;
}
</style>
</head>
<body>
<div style="width:100%;" align="center">
<div style="width:800px;">
<div style="width:100px; float:left;">testo1</div>
<div style="width:100px;">testo2</div>
</div>
</div>
</body>
</html>
Funziona tutto bene, se però scrivo:
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Documento senza titolo</title>
<style>
div{
border:1px #000000 solid;
}
</style>
</head>
<body>
<div style="width:100%;" align="center">
<div style="width:800px;">
<div style="width:100px; float:left;">testo1</div>
<div style="width:100px; float:left;">testo2</div>
</div>
</div>
</body>
</html>
e cioè mettendo il float anche al div con testo2 i due div più esterni si appiattiscono, perchè?
Se provate i codici vi accorgete subito quello che intendo