1 388jintao 2014-01-06 23:51:11 +08:00 这样不是挺好的嘛,应该是你高度用的百分比的缘故吧 |
![]() | 2 kshift 2014-01-06 23:56:05 +08:00 #content { min-height: xxxpx; } xxx 随便写个你想要的高度嘛。 |
3 amgo 2014-01-07 00:09:33 +08:00 非要这样实现的话 footer用margin-top取一个足够大的值,别忘了删除 position: absolute及相关的 ps:不建议你这样做,正如楼上说的,目前这样挺好的 |
![]() | 4 miniwade514 2014-01-07 07:34:50 +08:00 via Android 不想变形就设置固定的高度值,想出现滚轮就给父元素加个 overflow-y: auto; |
5 Navee 2014-01-07 08:58:58 +08:00 给容器一个固定的高度和宽度,再加上overflow:auto;样式应该就能达到你要的效果了 |
![]() | 6 hkongm 2014-01-07 09:03:38 +08:00 1. 元素必须有高 2. overflow:scroll |
![]() | 7 jazdelu OP 回复以上 因为想把footer一直固定在底端所以采用了position:absolute的做法。。 但是好像窗口高度变小,中间的内容就会和footer重合在一起很不好看。。 于是采用了 @media only screen and (max-height : 600px) { #footer{ position: relative; margin-top: 20px; } } 当窗口高度小于600或其他值时将position改为relative.. 倒时可以简陋得解决这个问题。。 |
![]() | 8 housne 2014-01-07 09:46:08 +08:00 可以搜索下 sticky footer |