0

これは簡単だと思いますが、行き詰まっています。

説明するためにここに簡単なデモがあります。

http://www.ttmt.org.uk/forum/

これはコンテナの幅です max-width(fluid)。

右の列は幅が設定されていますが、左の列は流動的で、フッターは下部に固定されています。

左の列(黄色)の高さを100%に拡張するだけで、フッターに触れます

    <!DOCTYPE html>
    <html>
      <head>
      <title>Title of the document</title>

      <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css">

      <style type="text/css">
        /*--stickyFooter--*/
        html, body {
          height: 100%;
        }

        #wrap {
          min-height: 100%;
          max-width:1000px;
          margin:0 auto;
          border-left:20px solid white;
          border-right:20px solid white;
        }

        #main {
          overflow:auto;
          padding-bottom: 150px;/* must be same height as the footer */
          height:100%;
          min-height:100%;
        }  

        footer {
          position: relative;
            margin:-150px auto 0 auto;
            height: 150px;
            clear:both;
            max-width:1000px;
            background:red;
            border-left:20px solid white;
          border-right:20px solid white;
        } 

        body:before {/*Opera Fix*/
            content:"";
            height:100%;
            float:left;
            width:0;
            margin-top:-32767px;/
        }
        /*--END-stickyFooter--*/

        header{
          height:100px;
          background:#ddd;
        }
        #rightCol{
          height:100px;
          background:#eee;
          width:200px;
          float:left;
        }
        #leftCol{
          margin-left:210px;
          background:yellow;
          height:auto;
          height:100%;
        }
      </style>

      </head>

    <body>

      <div id="wrap">

        <header>
          <h2>Header</h2>
        </header>

        <div id="main">
          <div id="rightCol">
           <h2>Right Col</h2>
          </div><!-- #rightCol -->
          <div id="leftCol">
            <h2>Left Col</h2>
           <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
             Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
                 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
          </div><!-- #leftCol -->
        </div>  

      </div><!--wrap-->

      <footer>
        <div id="footer-container">
          <h2>Footer</h2>
        </div><!-- #footer-container -->
      </footer>  

    </body>

    </html>
4

1 に答える 1