2008-01-15
避免浏览器边上的滚动条
CSS 2.1
overflow
Value: visible | hidden | scroll | auto | inherit
Initial: visible
Applies to: non-replaced block-level elements, table cells, and
inline-block elements
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified
IE缺省会在右边显示一个竖直滚动条。但是这个实现与我的期望不一致。我希望内容不足以撑开页面高度的时候,这个竖直滚动条不要显示。
或者说body.overflow缺省取值是visible,我希望他是auto。
以往的处理方式往往是设置 body.scroll = no或者body.scroll=auto,这个scroll属性是IE特有的,使用起来也有种种弊端。
visible
This value indicates that content is not clipped, i.e., it may be rendered outside
the block box.
hidden
This value indicates that the content is clipped and that no scrolling user
interface should be provided to view the content outside the clipping region.
scroll
This value indicates that the content is clipped and that if the user agent uses a
scrolling mechanism that is visible on the screen (such as a scroll bar or a
panner), that mechanism should be displayed for a box whether or not any of its
content is clipped. This avoids any problem with scrollbars appearing and
disappearing in a dynamic environment. When this value is specified and the
target medium is ’print’, overflowing content may be printed.
auto
The behavior of the ’auto’ value is user agent-dependent, but should cause a
scrolling mechanism to be provided for overflowing boxes.
overflow
Value: visible | hidden | scroll | auto | inherit
Initial: visible
Applies to: non-replaced block-level elements, table cells, and
inline-block elements
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified
IE缺省会在右边显示一个竖直滚动条。但是这个实现与我的期望不一致。我希望内容不足以撑开页面高度的时候,这个竖直滚动条不要显示。
或者说body.overflow缺省取值是visible,我希望他是auto。
以往的处理方式往往是设置 body.scroll = no或者body.scroll=auto,这个scroll属性是IE特有的,使用起来也有种种弊端。
visible
This value indicates that content is not clipped, i.e., it may be rendered outside
the block box.
hidden
This value indicates that the content is clipped and that no scrolling user
interface should be provided to view the content outside the clipping region.
scroll
This value indicates that the content is clipped and that if the user agent uses a
scrolling mechanism that is visible on the screen (such as a scroll bar or a
panner), that mechanism should be displayed for a box whether or not any of its
content is clipped. This avoids any problem with scrollbars appearing and
disappearing in a dynamic environment. When this value is specified and the
target medium is ’print’, overflowing content may be printed.
auto
The behavior of the ’auto’ value is user agent-dependent, but should cause a
scrolling mechanism to be provided for overflowing boxes.
发表评论
- 浏览: 3092 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
Eclipse and Glassfish / ...
那你这里写什么?不要发这种无聊的帖子。
-- by 魔力猫咪 -
补充说一下120亿光年
这个是可测宇宙,前提是研究不可测的东西是无意义的。
-- by magicgod -
补充说一下120亿光年
以地球为中心,120亿光年半径划一个球体,那只是你想像要这么划的吧,你的假设是建 ...
-- by fuliang -
补充说一下120亿光年
嗯。咱们得承认这么大的尺度上考虑问题,咱们常规的思考手段都可能有问题。这么说吧。 ...
-- by greens.leaf -
补充说一下120亿光年
有问题: 引用以地球为中心,120亿光年半径划一个球体。尽管这个球体内广阔的空间 ...
-- by ds3783






评论排行榜