避免浏览器边上的滚动条

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特有的,使用起来也有种种弊端。

[i][b]visible [/b][/i]
This value indicates that content is not clipped, i.e., it may be rendered outside
the block box.
[i][b]hidden [/b][/i]
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.
[i][b]scroll [/b][/i]
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.
[i][b]auto [/b][/i]
The behavior of the ’auto’ value is user agent-dependent, but should cause a
scrolling mechanism to be provided for overflowing boxes.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值