Hat es drauf
AW: Mehrere Hintergrundbilder mit HTML/CSS
warum machst du es dir eigentlich so schwer?
margin: auto; alleine bringt dir nichts? Du solltest dir mal das CSS Box Modell nochmal genauer ansehen.
Gruß hellemon
warum machst du es dir eigentlich so schwer?
Code:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>HTML5 Layout</title>
<style type="text/css">
<!--
#header {
width: 95%;
height: 500px;
background: blue;
border: 1px solid red;
}
.inside {
width: 900px;
height: 400px;
margin: 0 auto;
border: 1px solid yellow;
}
=-->
</style>
</head>
<body>
<div id="header">
<div class="inside">Text
</div
</div>
</body>
</html>
margin: auto; alleine bringt dir nichts? Du solltest dir mal das CSS Box Modell nochmal genauer ansehen.
Gruß hellemon
Mit dem Sternselektor die Werte von margin und padding zurücksetzen ("reseten"). Dann gibt es auch keine Probleme.