2014-04-23 93 views
0

我想要的是,我的.content_pro始終粘貼在頁腳的頂部,屏幕的分辨率是多少。但是當我說身高:100%時,它會在我的腳下。一世'。與這掙了幾個小時,但它不會工作。這是我的HTML CSS &:當內容爲100%時,頁腳重疊內容

HTML:

<!--Begin Content-->  
<div id="content_pro"> 
    <div id="pro_menu"> 
     <div class="grey"><img class="pro_img" src="images/bannehof.jpg"><a href="subpages/bannehof.html" target="targetframe" class="pro_title">Bannehof</a><br /><br />Deuren c.a. 750</div> 
     <div class="white"><img class="pro_img" src="images/casaconfetti.jpg"><a href="subpages/casaconfetti.html" target="targetframe" class="pro_title">Casa Confetti</a><br /><br />Deuren c.a. 850</div> 
     <div class="grey"><img class="pro_img" src="images/citymax.jpg"><a href="subpages/citymax.html" target="targetframe" class="pro_title">Citymax</a><br /><br />Deuren c.a. 2200</div> 
     <div class="white"><img class="pro_img" src="images/nielsborghplaats.jpg"><a href="subpages/nielsborghplaats.html" target="targetframe" class="pro_title">Niels Borghplaat</a><br /><br />Deuren c.a. 15</div> 
     <div class="grey"><img class="pro_img" src="images/ronssehof.jpg"><a href="subpages/ronssehof.html" target="targetframe" class="pro_title">Ronssehof</a><br /><br />Deuren c.a. 2500</div> 
     <div class="white"><img class="pro_img" src="images/rusthoeve.jpg"><a href="subpages/rusthoeve.html" target="targetframe" class="pro_title">Rusthoeve</a><br /><br />Deuren c.a. 255</div> 
     <div class="grey"><img class="pro_img" src="images/westerbeek.jpg"><a href="subpages/westerbeek.html" target="targetframe" class="pro_title">Westerbeek</a><br /><br />Deuren c.a. 350</div> 
    </div> 
     <iframe class="pro_subpage" src="subpages/bannehof.html" name="targetframe" allowTransparency="true" scrolling="no" frameborder="0" ></iframe> 
</div> 
<!--End Content--> 
</div>  
<!--Begin Footer--> 
    <footer> 
    <div id="foo_container"> 
     <div id="foo_navs"> 
      <div id="foo_nav_1"> 
       &raquo <a href="../index.html">Home</a><br /> 
       &raquo <a href="../deuren">Deuren</a><br /> 
       &raquo <a href="../hangensluitwerk">Hang en Sluitwerk</a><br /> 
       &raquo <a href="#">Projectbasis</a><br /> 
      </div> 
      <div class="foo_sep"></div>   
      <div id="foo_nav_2"> 
       &raquo <a href="../particulier">Particulier</a><br /> 
       &raquo <a href="../recenties">Recenties</a><br /> 
       &raquo <a href="../fotos">Foto's</a><br /> 
       &raquo <a href="../werkwijze">Werkwijze</a> 
      </div> 
      <div class="foo_sep"></div> 
      <div id="foo_nav_3"> 
       &raquo <a href="../contact">Contact</a> 
      </div> 
      <div class="foo_sep"></div> 
      <div id="copyright"> 
       Copyright &copy;<br /> <a href="http://www.grafisch-centrum.nl" target="_blank">Grafisch Centrum Etten-Leur</a> 2014 
      </div> 
     </div> 
     <div id="foo_keurmerk"> 
      <a href="http://www.inbraakproef.nl" target="_blank"><img class="foo_inbraak" src="../images/pkvw-logo.png" /></a> 
      <a href="../images/VCA07042011Roos.tiff"><img class="foo_vca" src="../images/vca1.png"/></a> 
      <div class="foo_sep_keurmerk"> 
     </div> 
     </div> 
     </div> 
    </footer> 
<!--End Footer--> 

CSS:

* { 
    width:100%; 
    margin:0 auto; 
    padding: 0; 
    font-family:arial; 
    overflow-x: hidden; 
    position: relative; 
} 

html, body { 
    height: 100%; 
} 

    #content_pro { 
    overflow: hidden; 
    z-index: 9; 
    height: 100%; 
} 

#pro_menu { 
    height: 84%; 
    width: 380px; 
    position: absolute; 
    float: left; 
    overflow-y: scroll; 
    margin: 80px 0px 25px 0px; 
    overflow-x: hidden; 
    z-index: 999; 
} 

footer, .push { 
    width: 100%; 
    background-color: #eb691e; 
    height: 100px; 
    z-index: 10; 
    overflow: hidden; 
} 

謝謝!

回答

0

首先要你從你的CSS中刪除這一步

* { 
    width:100%; 
    margin:0 auto; 
    padding: 0; 
    font-family:arial; 
    overflow-x: hidden; 
    position: relative; 
} 

你可以只留下那些,但有時額外的規則,沒有必要使用它

* { 
    margin:0; 
    padding:0; 
} 

FONT-FAMILY你需要用於身體標籤 - 像這樣

body { 
    font: Arial, Helvetica, sans-serif; 
} 

至於你的問題。下面是一個例子,如何堅持頁腳底部(如我正確理解你想要什麼來實現)

HTML

<div id="wrapper"> 
    <div class="w1">sdfsdfsd</div> 
</div> 
<footer id="footer">ssdfsdfs</footer> 

CSS

html, body { 
    height: 100%; 
    margin: 0; 
} 
#wrapper { 
    min-height: 100%; 
    width: 100%; 
} 
.w1 {padding-bottom:50px /*footer height*/;} 
#footer { 
    height: 50px; 
    margin-top: -50px; /*equal to footer height */ 
    position: relative; 
    width: 100%; 
} 
0

如果我正確理解你的問題,那麼這樣的事情我會猜測。剛添加填充。

這裏是小提琴http://jsfiddle.net/9cKTH/

* { 
    width:100%; 
    margin:0 auto; 
    padding: 0; 
    font-family:arial; 
    overflow-x: hidden; 
    position: relative; 
} 

html, body { 
    height: 100%; 
} 

    #content_pro { 
    overflow: hidden; 
    z-index: 9; 
    height: 100%; 
    padding-bottom:50px; 
} 

#pro_menu { 
    height: 84%; 
    width: 380px; 
    position: absolute; 
    float: left; 
    overflow-y: scroll; 
    margin: 80px 0px 25px 0px; 
    overflow-x: hidden; 
    z-index: 999; 
} 

footer, .push { 
    width: 100%; 
    background-color: #eb691e; 
    height: 100px; 
    z-index: 10; 
    overflow: hidden; 
} 

這是你想要的?

+0

不完全是。我對不起,如果你不明白我的意思,我不擅長用這種方式提問。但我想要的是內容的底部始終貼在頁腳的頂部。因此,如果您使瀏覽器窗口變大或變小,則頁腳已經始終保持在底部,但我希望內容隨其移動。而且我發現我的html和css有點被我試過的東西毀了。 – wbjari