• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

.css Frage

pl0x

Neues Mitglied
Hallo HTML.de User & Co. ,
Ich habe mal eine Frage zu CSS. Ich bin grade dabei mein Design was an HTML/CSS angepasst wurde zu centern. (mittig machen) Das Problem ist das ich nicht weiß wie es geht.
Hier der Code:
Code:
body
{
     margin-left: auto;
    margin-right: auto;
    padding: 0px;
    color: #000;
    font-family: Tahoma, Geneva, sans-serif;
    font-size: 13px;
    line-height: 1.7em;
    background-color: #0a4b77;          
    background-position: top;
    background-repeat: repeat-x;

}


a, a:link, a:visited { color: #777700; text-decoration: none; }
a:hover { color: #808080; text-decoration: underline; }

p { margin: 0 0 10px 0; padding: 0; }
img { border: none; }

h1, h2, h3, h4, h5, h6 { color: #252323; font-weight: normal }

#main_top {
    position: absolute;
    top: 10px;
    left: 70px;
    padding:2px;
    width: 900px;
    height: 243px;
    background: url(images/content_top.png) no-repeat
}

#header {
    position: relative;
    left: 4.5px;
    width: 890px;
    height: 196px;
    background: url(images/header.jpg) no-repeat center top

}

#logo {
    position: relative;
    left: 4.5px;
    top: 45px;
    width: 350px;
    height: 90px;
    background: url(images/logo.png) no-repeat center top

}

#menu {
    position: relative;
    left: 70px;
    top: 222px;
    width: 904px;
    height: 70px;
    background: url(images/menü.png) no-repeat;
}

#menu ul {
    height: 70px;
    margin: 0;
    padding: 1px 0 0 0;
    list-style: none;
}

#menu ul li {
    padding: 0;     
    margin: 0;
    display: block;
}

#menu ul li a {
    float: left;
    display: block;
    height: 25px;
    padding: 8px 52px 0 50px;
    font-size: 15px;
    color: #000000;
    text-align: center;
    text-decoration: none;
    background: url(images/menu_divider.png) center right no-repeat;
}

#menu ul li a:hover, #menu ul .current {
    color: #0033FF;
}

#menu ul .last { 
    background: none; 
    padding-right: 52px 
}
#oben {
    position: relative;
    left: 70px;
    top: 190px;
    width: 905px;
    height: 300px;
    background: url(images/conten_oben.jpg) no-repeat;
}

.banner_box { 
    position: relative;
    top: 10px;
    left: 100px;
    clear: both;    
    width: 235px; 
    margin-bottom: 30px; 
}

.we_title {

    width: 800px;
    height: 20px;
    padding: 4px 30px;
    font-size: 14px;
    color: #ffffff;
    background: url(images/sidebar_box_top.jpg) no-repeat top left;
}
.we_content {
    padding: 15px 25px;
    width: 800px;
    background: url(images/sidebar_box_middle.jpg) repeat-y left;
}
.we_bottom {
    width: 800px;
    background: url(images/sidebar_box_bottom.jpg) no-repeat top left;
}

.seid_box {
    position: absolute;
    left: 780px;
    top: 270px;
    clear: both;
    width: 50px;
    margin-bottom: 30px;
}
.sb_title {
    width: 130px;
    height: auto;
    padding: 4px 30px;
    font-size: 14px;
    color: #ffffff;
    background: url(images/sidebar_box_top.jpg) no-repeat top left;
}
.sb_content {
    padding: 15px 25px;
    width: 180px;
    background: url(images/sidebar_boxx_middle.jpg) repeat-y left;
}
.sb_bottom {
    width: 800px;
    background: url(images/sidebar_box_bottom.jpg) no-repeat top left;
}
.seid_box2 {
    position: absolute;
    left: 780px;
    top: 500px;
    clear: both;
    width: 50px;
    margin-bottom: 30px;
}
.sb_title2 {
    width: 130px;
    height: auto;
    padding: 4px 30px;
    font-size: 14px;
    color: #ffffff;
    background: url(images/sidebar_box_top.jpg) no-repeat top left;
}
.sb_content2 {
    padding: 15px 25px;
    width: 180px;
    background: url(images/sidebar_boxx_middle.jpg) repeat-y left;
}
.sb_bottom2 {
    width: 800px;
    background: url(images/sidebar_box_bottom.jpg) no-repeat top left;
}
.sb_bottom2 {
    width: 800px;
    background: url(images/sidebar_box_bottom.jpg) no-repeat top left;
}
.seid_box3 {
    position: absolute;
    left: 780px;
    top: 800px;
    clear: both;
    width: 50px;
    margin-bottom: 30px;
}
.sb_title3 {
    width: 130px;
    height: auto;
    padding: 4px 30px;
    font-size: 14px;
    color: #ffffff;
    background: url(images/sidebar_box_top.jpg) no-repeat top left;
}
.sb_content3 {
    padding: 15px 25px;
    width: 180px;
    background: url(images/sidebar_boxx_middle.jpg) repeat-y left;
}
.sb_bottom3 {
    width: 800px;
    background: url(images/sidebar_box_bottom.jpg) no-repeat top left;
}

#content {
    position: relative;
    top: 50px;
    left: 70px;
    background-color:#FFFFFF;
    width: 905px;

}
#footer {
    position: relative;
    top: 42px;
    left: 200px;
    width: 905px;
    margin: 0 auto;
    color: #ffffff;
    padding: 5px 0;
}
#footer a {    color: #C0C0C0;}

Wie bekomme ich nun das Design mittig? (center)

MfG
 
mach ein DIV um das gesamte Layot, gib ihm die breite des Layouts und margin:auto;
Zusätzlich für den IE noch text-align:center; in den body
 
Zurück
Oben