Zum Inhalt springen

Unterschiedliche Länge des Hintergrunds in Firefox und Internet Explorer

Erstellt am 23. Oktober 2010 · 3 Antworten · letzte Antwort am 6. Dezember 2010

Tags: HTML & CSS, Frage

miami ·

Hallo!

Ich habe das Problem, dass mir im Firefox der Hintergrund nicht richtig angezeigt wird. (s. Screenshot)
Im Internet-Explorer funktioniert es einwandfrei, d.h. der dunklere Strich hört auch mit dem Text auf.

Mein template dazu

<html>
<head>

<title>xxx</title>
<link rel="stylesheet" type="text/css" href="fileadmin/templates/style.css" />
</head>

<body>
<!-- ###DOKUMENT### begin -->
	<div id="container">
		<div id="head">
			<img src="fileadmin/images/templates/logo.gif" width="333" height="72">
			<!-- ###HEADER### -->
		</div>
		<div id="top">
			###MENU_OBEN###

		</div>
		<div id="links">
			###MENU_LINKS###
		</div>
		<div id="center">
			###MITTE_CONTENT###
		</div>
		<div id="right">
			###RECHTS###
		</div>
	</div>
	<div id="footer">
			###FOOTER###
	</div>
	
<!-- ###DOKUMENT### end -->
</body>
</html>

Und meine CSS Datei
Dabei ist der "große Rahmen mit dem dunkleren Rand" der div#container und das, was darüber hinaus ragt div#center.

h1{
font: normal 14px Helvetica,Verdana,Arial;
font-weight: bold;
padding: 50 0 0 20;
}

div,img{
margin:0;
padding:0;
border:0;
}


body{
text-align:center;
height: 100%;
margin: 5px;
background: #AAAAAA;
}

div#head {
padding: 5px;
/* padding: 5px 0px 5px 5px; */
font: normal 10px Helvetica,Verdana,Arial;
text-align:right;
background-color:#FFF8E8;
float:right;
}

div#container{
width: 1000px;
text-align: left;
margin: 0px auto;
background: #FFF8E8;
padding: 0px 15px 5px 15px;
font-family: Arial, Helvetica, sans-serif;
border: 1px solid #FA4F4F;
 min-height:   95%; 
 overflow: hidden !mportant;
 height: auto !important;
}

div#top {
font: 14px Arial;
clear:both;
background-color:#FFEECA;
text-align: center;
color: #FA4F4F;
padding:  5px;
padding-right: 10px;
border-top: 1px solid #FA4F4F;
}


a.linkTop {
	text-decoration: none;
	color: #FA2020; 
 	padding: 5px; 
	}
	
a:hover.linkTop {
	background-color: #FFD080;
	}

a:active.linkTop {
	background-color: #FFAAAA;
	}
	
a:current.linkTop {
	background-color: silver;
	}

div#linksheadline{
clear:left;
float:left;
width:120px;
padding: 10px 0px 5px 0px;
background-color:#FFF8E8;
border-bottom: 1px solid #040266;
position:absolute;
font-size:10px;
}

a.linkLinksH {
	text-decoration:none;
	color:#040266;
	padding: 5px;
	}

a:hover.linkLinksH {
	background-color: #FFF8E8;
	}

a:active.linkLinksH{
	background-color: #DDF8E8;
	}

div#links{
float:left;
width:130px;
padding: 10px 0px 10px 0px;
background-color:#FFF8E8;
}

a.linkLinks {
	text-decoration:none;
	color:#040266;
	padding: 5px 5px 5px 5px;
	}

a:hover.linkLinks {
	background-color:#FFF8E8;
	}

a:active.linkLinks{
	background-color:#FFF8E8;
	}

div#center {
	float:left;
	width:660px;
	padding: 0px 10px 10px 10px;
	color:#040266;
	font-size:13px;
	background: #FFF8E8;
	height: auto;
		}
	
div#center .bodytext {
	margin: 0 0 0 20;
	}

div#right {
	float:left;
	width:150px;
	height:auto;
	padding:10px;
	border:1px black;
	font-size:13px;
	color:#040266;
	background: #FFF8E8;
	}
	
div#right .bodytext {
	margin: 0 0 0 20;
	}

div#footer {
clear:both;
/* background: #AAAAAA; */
padding:4px;
padding-bottom:2px;
color: #FA4F4F; 
font-family: Arial, Helvetica, sans-serif;
font-size:13px;
}

div#footer a {
text-decoration:none;
color:white;
}

div#links_bottom{
text-align:center;
background-color:#8BA2BA;
margin-top:20px;
padding-top:1px;
padding-bottom:1px;
}

 .float-left{float:left;}

Vielleicht kann mir da jemand helfen, dass auch beim Firefox in eine Linie zu bringen?

Danke!

etux ·

Ich nehme an, DOCTYPE fehlt nur in der Vorlage und nicht in Deiner TYPO3-Installation. Sonst würde es auch im Firefox funktionieren, auch wenn Du „clear“ falsch einsetzest. Stichwort „Quircks Modus“.
div#container schließt die Floats nicht ein, da Du eben an der falschen Stelle clearst.
Du könntest auf div#container „Easy Clearing“ anwenden, oder aber einfach div#footer auch in div#container mit aufnehmen.
Im IE funktioniert es, weil div#container „hasLayout“ hat. Elementen mit „hasLayout = true“ schließen Floats ein.

miami ·

Hallo!

In der HTML-Vorlage habe ich

<!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" xml:lang="de-DE" lang="de-DE">

definiert.

Muss ich da im Typo3 selber auch noch was einstellen?
Wenn ja, wo und was?

Wie müsste ich die Clear anwenden, damit es funktioniert?

miami ·

Problem gelöst.

In das HTML Template ein leeres Div eingefügt.

Beim CSS folgendes geändert:

div#leer{ 
clear: both;
}

Und bei div#footer das

clear:both;

raus

Danke für die Hilfe!