避免瀏覽器邊上的滾動條

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.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章