• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

[CSS] IE verdoppelt margin

kasimir83

Lounge-Member
Morjens.

Folgendes Snippet sieht in FiFo und Opera aus wie gewollt. Im IE wird der margin-left von 5 auf 10 Pixel verdoppelt. Sobald ich float:left rausnehme passt es wieder, aber das Float brauch ich schon. Was treibt der IE da?

Code:
<!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=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
	body
	{
		margin:0px;
		background-color:#3f76a0;
	}
	#menuContainer
	{
		width:130px;
		height:497px;
		margin:5px 5px 5px 5px;
		background-color:#CCFF33;
		overflow:hidden;
		float:left;
	}
	#content
	{
		float:left;
		width:520px;
		height:497px;
		margin:5px 5px 5px 0px;
		background-color:#00CC99;
		overflow:hidden;
		
	}
</style>
</head>

<body>
	<div id="menuContainer"></div>
	<div id="content"></div>
</body>
</html>

Danke
kasimir
 
Hehe, denkste.

Hier der komplette Container-Code:
Code:
<!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=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
	body
	{
		margin:0px;
		padding:0px;
		background-color:#3f76a0;
	}
	#container
	{
		margin-left:auto;
		margin-right:auto;
		margin-top:0px;
		margin-bottom:0px;
		padding:0px;
		left:-385px;
		width:770px;
		height:597px;
		text-align:left;
		background-color:#6591b3;
		border-left:#333366 solid 1px;
		border-right:#333366 solid 1px;
		border-bottom:#333366 solid 1px;
		border-top:#333366 solid 0px;
	}

	#header
	{
		margin:0px 5px 0px 5px;
		width:760px;
		height:100px;
		background-color:#009900
	}
	#menuContainer
	{
		width:130px;
		height:487px;
		margin:5px 5px 5px 5px;
		background-color:#CCFF33;
		overflow:hidden;
		float:left;
	}
	#content
	{
		float:left;
		width:500px;
		height:487px;
		margin:5px 5px 5px 0px;
		background-color:#00CC99;
		overflow:hidden;
		
	}
	
	#help
	{
		float:left;
		width:120px;
		height:487px;
		margin:5px 5px 5px 0px;
		background-color:#9966CC;
	}
</style>
</head>

<body>
	<div id="container">
		<div id="header"></div>
		<div id="menuContainer"></div>
		<div id="content"></div>
		<div id="help"></div>
	</div>
</body>
</html>
Ich hab grad 'ne Denkblockade, lässt sich deine Idee da rein übertragen?

Danke dir
sagt Kasimir
 
Würde ich in der Art machen:
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=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
body{
margin:0;
padding:0;
background-color:#3f76a0;
}
#container{
margin:0 auto;
width:770px;
height:597px;
background-color:#6591b3;
border-left:#333366 solid 1px;
border-right:#333366 solid 1px;
border-bottom:#333366 solid 1px;
border-top:#333366 solid 0px;
}
#header{
width:760px;
height:100px;
background-color:#009900
}
#menuContainer{
width:130px;
height:487px;
margin:5px 5px 0 0;
background-color:#CCFF33;
overflow:hidden;
float:left;
}
#content{
float:left;
width:500px;
height:487px;
margin:5px 5px 0 0;
background-color:#00CC99;
overflow:hidden;
}
#help{
float:left;
width:120px;
height:487px;
margin:5px 0 0 0;
background-color:#9966CC;
}
</style>
</head>
<body>
<div id="container">
<div style="margin:0 5px;">
<div id="header">header</div>
<div id="menuContainer">menuContainer</div>
<div id="content">content</div>
<div id="help">help</div>
</div>
</div>
</body>
</html>
Ahoi - Pit
 
Hey cool, danke dir.
Gut wenn man jemanden kennt der sein Leben der Umgehung von Browser-Macken gewidmet hat. ;)
 
Zurück
Oben