Ich möchte eine zentrierte Kopf DIV und im Inneren die folgenden absolut positionierte DIVs:Ist dies der Weg absolute/relative/statische CSS DIVs zu machen?
- logo
- Menü
- Linie
- Titel
Aber mein HTML/CSS hat zwei Probleme :
- für so ich Grund, die Seite ist jetzt breite (untere Bildlaufleiste sehen)
- Wenn mein Titel mehr, ich will es rechtsbündig natürlich seine
Was ich wirklich will, ist eine zentrierte DIV und innerhalb dieser I will DIVs absolut innerhalb ihres zentrierten Elternteils positionieren (aber nicht absolut, da sie nicht zentriert sein würden). Ist das möglich?
Wie würden Sie dieses Layout erreichen?
alt text http://tanguay.info/web/external/centeredLayoutProblem.png
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
#headerArea {
background-color: yellow;
margin: 0px auto;
width: 760px;
height: 150px;
}
#logo {
position: relative;
top: 20px;
left: 20px;
background-color: orange;
text-align: center;
font-size: 32pt;
width: 150px;
padding: 10px;
z-index: 10;
}
#menu {
position: relative;
top: -52px;
right: -480px;
background-color: tomato;
text-align: center;
font-size: 14pt;
width: 240px;
padding: 10px;
}
#title {
position: relative;
top: -35px;
right: -620px;
font-style: italic;
font-size: 14pt;
}
#line {
position: relative;
top: -60px;
border-bottom: 1px solid blue;
margin: 0 20px;
}
</style>
</head>
<body>
<div id="headerArea">
<div id="logo">LOGO</div>
<div id="menu">One Two Three Four Five</div>
<div id="title">This is the Title a Bit Longer</div>
<div id="line"></div>
</div>
</body>
</html>
genial, sieht gut aus in allen vier Test-Browsern, lernte auch etwas, danke! –