Autor |
Nachricht |
ject
Threadersteller
Dabei seit: 03.04.2007
Ort: -
Alter: -
Geschlecht: -
|
Verfasst Fr 02.05.2008 14:02
Titel ie7 problem? |
|
|
Hi leute,
hab hier wieder mal ein positionierungsproblem in html/css:
Ich hab oben ein absolut positioniertes div mit 100% weite,
darunter möchte ich ein horizontal zentriertes div haben.
Ich habe es wie unten gelöst (unteres div relativ pos. und margin:auto), was
in FF auch fein funktioniert, ie7 aber schiebt das obere div nach rechts (dh das untere div bleibt
zentriert, das obere beginnt direkt über dem unteren....)
Warum?
Code: |
<style type="text/css">
<!--
body {
background-color: #693c01;
width:100%;
margin:0px;
}
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFCC00;
}
#header {
position:absolute;
width:100%;
height:108px;
background:#c0da4c;
background-image:url(header2.jpg);
background-position:center;
background-repeat:no-repeat;
}
#contentholder{
position:relative;
top:140px;
width:700px;
margin: 0 auto;
}
#content {
position:relative;
width:700px;
background:#8c5002;
padding:5px;
overflow: hidden;
}
-->
</style></head>
<body>
<div id="header"></div>
<div id="contentholder">
<div id="content"></div>
</div>
</body>
</html>
|
|
|
|
|
|
raziel
Dabei seit: 29.05.2006
Ort: Saarbrücken
Alter: 39
Geschlecht: -
|
Verfasst Fr 02.05.2008 14:10
Titel
|
|
|
eine div hat immer die breite 100% wenn sie nicht gefloatet wurde.
Ich würde auch nicht position benutzen...
|
|
|
|
|
Anzeige
|
|
|
zweitaccount
Dabei seit: 25.01.2008
Ort: -
Alter: -
Geschlecht: -
|
Verfasst Fr 02.05.2008 14:18
Titel
|
|
|
Meinst Du so?
Code: | <style type="text/css">
<!--
BODY {
background-color: #693c01;
margin:0;
padding:0;
text-align:center;
}
BODY, TD, TH {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFCC00;
}
DIV#header {
position:relative;
height:108px;
background:#c0da4c;
background-image:url(header2.jpg);
background-position:center;
background-repeat:no-repeat;
}
DIV#contentholder{
position:relative;
top:10px;
width:700px;
margin: 0 auto;
text-align:left;
}
DIV#content {
position:relative;
width:700px;
background:#8c5002;
padding:5px;
overflow: hidden;
}
-->
</style> |
|
|
|
|
|
ject
Threadersteller
Dabei seit: 03.04.2007
Ort: -
Alter: -
Geschlecht: -
|
Verfasst Fr 02.05.2008 15:18
Titel
|
|
|
jup, das war´s. Hatte es zwar schon ohne width-angabe probiert, aber die positionierung
absolt gelassen...
|
|
|
|
|
|
|
|
Ähnliche Themen |
Formmailer-Problem-neues problem
xtc-Problem
Problem mit IE
Problem in IE
JS DIV-Problem
CSS-Problem?
|
|