2013-03-20 92 views
0

我有一个包含2行3个链接的页脚 - 当浏览器窗口被调整大小并且太小时,链接被切断。有什么方法可以保持页脚全尺寸,而窗口的其他部分被调整大小?自动页脚大小调整CSS

.footer { position: fixed; top: 90%; left: 0; right: 0; bottom: 0; 
     background: #ffffff; border: solid black; border-width: 2px 0 0 0; } 
+0

给它的尺寸? – advermark 2013-03-20 15:02:06

+1

如果你制作了[小提琴](http://jsfiddle.net/),也许会有所帮助?我猜你是在说底部的内容在底部被裁剪掉,因为底部高度不够长,无法显示出来?我认为这将是您使用的方法的固有问题。也许如果你解释你想要做什么,可以提出替代解决方案?在我的头顶,你可以使用媒体查询来缩小页脚的字体大小,因为页面缩小了,试图让它适合。 – jmbertucci 2013-03-20 15:10:00

+0

http://jsfiddle.net/utb6z/ 听起来像你是对的固有问题。我试图用一个div将页面分成4个不同的彩色象限。然后添加页脚。 – 2013-03-20 15:23:31

回答

0

设置 “最小宽度” 为您的div

.footer { 
    position: fixed; 
    top: 90%; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: #fff; 
    border-top: 2px solid #000; 

    min-width: 200px; 
} 
+0

这并不是我所关心的宽度,而是高度。当窗口是半高时,页脚不调整。 – 2013-03-20 15:20:41

0

添加min-height到页脚,如图this fiddle

.footer { 
    position: fixed; 
    height: 10%; 
    min-height: 40px; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: #fff; 
    border-top: 2px solid black; 
} 
0

被页脚固定在底部的页面选项?只是删除了top: 90%;和页脚将保留它的高度,甚至当窗口一半大小

.footer { 
    position: fixed; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: #fff; 
    border-top: 2px solid #000; 
} 

PS我叉你的提琴:http://jsfiddle.net/6s5eN/