2012-08-01 235 views
0

我将我的div设置为固定位置,当我将页面滚动到底部时,或者如果使用智能手机或平板电脑等较小的屏幕,我的固定div就会浮在我的页脚上。我怎样才能解决这个问题?固定宽度格

这是我固定的div:

.infoItem{ 
    -webkit-border-radius: 15px; 
    -moz-border-radius: 15px; 
    border-radius: 15px; 
    border: 1px #e4e4e4 solid; 
    width: 227px; 
    background:#f8f6f7; 
    position: fixed; 
} 

,这是我的包装:

.wrapper { 
    min-width:954px; 
} 

我也试着换我infoteam格在另一个DIV和设置新的div是position: absolute但也没有工作。

<div style="clear:both"></div> 

这将迫使以下任一元素:

定格HTML

<div class="box-collateral box-up-sell"> 

     <div class="infoItem"> 
      <p class="heading">Add to your </p> 
      <p class="content"> 

         <div class='upsellContainer'> 

           <div> 

           </div> 
         </div> 

      </p> 
     </div> 
    </div> 

页脚CSS

.footer { background:url(../images/footer-top-border.png) repeat-x;} 
/* .footer-container { border-top:15px solid #b6d1e2; }*/ 

.footer { width:904px; margin:0 auto; padding:30px 10px 50px; } 
.footer .store-switcher { display:inline; margin:0 5px 0 0; color:#fff; } 
.footer .store-switcher label { font-weight:bold; vertical-align:middle; } 
.footer .store-switcher select { padding:0; vertical-align:middle; } 
.footer a {text-decoration:none; } 
.footer a:hover { text-decoration:underline; } 
.footer .bugs { margin:13px 0 0; } 
.footer .bugs a { text-decoration:underline; } 
.footer .bugs a:hover { text-decoration:none; } 
.footer address { margin:0 0 20px; } 
.footer address a {text-decoration:underline; } 
.footer address a:hover { text-decoration:none; } 
.footer ul { display:inline; } 
.footer ul.links { display:block; } 
.footer li { background:url(../images/bkg_pipe2.gif) 100% 60% no-repeat; padding:0 7px 0 4px; } 
.footer li.last { background:none !important; padding-right:0 !important; } 
.footer-container .bottom-container { margin:0 0 5px; } 
+0

我可以看到你的页脚的CSS?也许包装,页眉和页脚的HTML。 – 2012-08-01 16:48:46

+0

你到目前为止尝试过什么?你的html是怎样的?你能提供一个实际问题的截图吗? – 2012-08-01 16:50:26

+0

是否有一个特定的原因,你已经修复了一个div中的内容。这将根据内容调整其高度,并自然地将其下的任何东西溢出。 你可以尝试更稳定的布局练习,通过浮动div或使用内联元素,如960.gs – Ollie 2012-08-01 16:50:26

回答

0

您的div后您的页脚像在此之前添加其他的div权它下降。您还希望确保页脚具有clear:both以及(这应该是页脚真)

0

使用clear:bothfooter div内或应用明确的:无论是在CSS,如:

#footer{ 
    clear: both; 
}