- 主题:请教:css垂直高度自适应
js吧。
【 在 Goofect (1 Win TO GO!) 的大作中提到: 】
: 上中下三层div,上下高50px,中层高度自适应.
: 如果中层高度超高,在中层上使用scoll,而不是整个页面.
: 要求纯css,支持常用浏览器
: ...................
--
FROM 114.243.222.*
如果expression也算css的话,就可以实现,部分浏览器下。
【 在 Goofect (1 Win TO GO!) 的大作中提到: 】
: js是好弄.
: 只是想知道纯css能不能做到,多复杂都可以.
--
FROM 114.243.222.*
查查去。。我也学习学习。。
【 在 Coooold (COoOold) 的大作中提到: 】
: chinaz上好像看到过相关文章,记不住了,大约可以做到
--
FROM 114.243.222.*
按照你的说法,
如果网页中可见区域的高是200px,
body设置height是100%,上下padding是50,
不管网页中有没有内容,整个页面被分割成3部分:
上下各50,中间100 ?
【 在 Goofect (1 Win TO GO!) 的大作中提到: 】
: 100%
: body设置padding往里撑了
: body的内容的高度正好扣掉了上下高度
: ...................
--
FROM 114.243.222.*
如果没任何内容,你body怎么设置高 ?
【 在 Goofect (1 Win TO GO!) 的大作中提到: 】
: 对.可能是我描述的不是很清晰.
: 我原来的想法就是要上靠顶,下靠底,
: 浏览器窗口大小可变,中间部分高度自适应窗口大小,填满整个高度,
: ...................
--
FROM 114.243.222.*
你好好研究研究吧。
【 在 Goofect (1 Win TO GO!) 的大作中提到: 】
: ??????????????????????????
: body的高度不是窗口大小决定的么
: 他给的那个方法,100%是div的height
: ...................
--
FROM 114.243.222.*
1、页面无doctype声明,运行在Quirks mode下,这个模式下的东西最好放弃研究跟
使用。
2、关于百分比高度,请参考:
http://www.w3.org/TR/CSS21/visudet.html#the-height-property
<percentage>
Specifies a percentage height. The percentage is calculated with
respect to the height of the generated box's containing block. If the
height of the containing block is not specified explicitly (i.e., it
depends on content height), and this element is not absolutely
positioned, the value computes to 'auto'. A percentage height on the
root element is relative to the initial containing block. Note: For
absolutely positioned elements whose containing block is based on a
block-level element, the percentage is calculated with respect to the
height of the padding box of that element. This is a change from CSS1,
where the percentage was always calculated with respect to the content
box of the parent element.
【 在 Goofect (1 Win TO GO!) 的大作中提到: 】
: 没明白你指的是什么
: 那个例子确实解决了我提的那个问题.
: IE7/Firefox/Chrome下都行.
: ...................
--
FROM 114.243.222.*