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

Problem bei CSS Layout

Mike1410

Neues Mitglied
hallo,

ich bin an einem css layout dran. (fix - fluid - fluid). was aber eine maximale und minimale breite haben soll. der header und der footer sollen aber immer komplett breit sein. zur besseren erklärung hiermal ein bild:

bsp_layout.jpg

weiss jemand einen rat ?

gruß Mike
 
Da sind aber Header und Footer nicht auf 100% des Fensters ;)
Nein, das wollte ich auch nicht. Ich wollte dich nur darauf hinweisen, dass es nett sein kann, den Footer wirklich am Window-Ende zu platzieren und nicht am Textende. Beim Footer müsste ich nur das derzeitige width:940px durch width:100% ersetzen. Den Header dann noch an den Anfang verschieben, aber wie gesagt, das war nicht die Planung.
 
HTML:
<!DOCTYPE html>

<html lang="en">

    <head>
        <meta charset="utf-8" />
        <title>New</title>
        <style type="text/css">

/**
 * new clearfix
 *
 * @see http://perishablepress.com/press/2009/12/06/new-clearfix-hack/
 */
.clear:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
    }
* html .clear             { zoom: 1; } /* IE6 */
*:first-child+html .clear { zoom: 1; } /* IE7 */

body {
    margin: 0;
    padding: 0;
}

.header, .footer {
    background: red;
}

.content {
    min-width: 800px;
    max-width: 1200px;
    border: 10px solid palevioletred;
    margin: 0 auto;
}

.col1 {
    width: 100px;
    background: blue;
    float: left;
}

.fluid {
    margin-left: 100px;
    background: green;
}

.fluid .col2 {
    width: 40%;
    background: cornflowerblue;
    float: left;
}

.fluid .col3 {
    width: 60%;
    background: lemonchiffon;
    float: left;
}

        </style>
    </head>

    <body>

        <div class="header">.header</div>
        
        <div class="content clear">
            <div class="col1">.col1</div>
            <div class="fluid clear">
                <div class="col2">.col2</div>
                <div class="col3">.col3</div>
            </div>
        </div>

        <div class="footer">.footer</div>

    </body>

</html>
 
Zurück
Oben