Hallo,
Folgende HTML:
Das Problem ist, dass sich das umschließende Div (form_wrapper) nicht der Breite des Inhalts (hier: label und input) anpasst. Im Browser kann man das durch die schwarze Umrandung des wrappers und die gepunktete rote der beiden Kindelemente beobachten.
Warum ist das so? Was habe ich falsch gemacht?
bounded
EDIT: bitte entschuldigt die fehlerhafte Formatierung
Folgende HTML:
HTML:
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Experimental</title>
<style type="text/css">
div#wrapper {
background-color:#CCC;
width:80%;
margin-left:auto;
margin-right:auto;
height:1000px;
}
div#first {
outline:1px solid yellow;
margin:25px 25px 0 25px;
}
form {
padding:15px;
}
div.form_wrapper {
border:1px solid black;
padding:25px;
}
label {
outline:1px dotted red;
}
input {
outline:1px dotted red;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="first">
<form>
<div class="form_wrapper">
<label>Hello</label>
<input type="text"></input>
</div>
</form>
</div>
</div>
</body>
</html>
Warum ist das so? Was habe ich falsch gemacht?
bounded
EDIT: bitte entschuldigt die fehlerhafte Formatierung