2014-09-04 71 views
1

我該如何拉伸側邊欄來填充頁面?保持中間1024px並拉伸側欄以填充頁面?

http://jsfiddle.net/p94vxnp2/1/

 <style> 
      #page_body_table { 
       display: table; 
       width: 100%; 
       vertical-align: center; 
      } 

      #page_body_left { 
       display: table-cell; 
       max-width: 100%; 
       border: 1px solid black; 
      } 

      #page_body_middle { 
       display: table-cell; 
       max-width: 1024px; 
       border: 1px solid black; 
      } 

      #page_body_right { 
       display: table-cell; 
       max-width: 100%; 
       border: 1px solid black; 
      } 

      @media screen and (max-width: 675px) { 
       #page_body_left, #page_body_right { 
        display: none; 
       } 
      } 
     </style> 
     <center> 
      <div id="page_body_left"> 
       left 
      </div> 
      <div id="page_body_middle"> 
       this is content of page 
      </div> 
      <div id="page_body_right"> 
       right 
      </div> 
     </center> 
+3

(http://jsfiddle.net/p94vxnp2/4/) – Vucko 2014-09-04 19:59:58

+1

@Vucko [喜歡這個?]:我想,作者想'寬度:1024px',不中間爲「max-width:1024px」。 – 2014-09-04 20:02:55

+0

將'display:table'添加到'#page_body'。另外,請將您的'