html隱藏滾輪條

2022-06-29 04:42:10 字數 1747 閱讀 6208

原文:

方法一, 利用 css 3 的新特性  -webkit-scrollbar, 但是這種方式不相容 火狐 和 ie

doctype html

>

<

html

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>超出部分隱藏滾動條

title

>

head

>

<

style

type

="text/css"

>

#box

#box::-webkit-scrollbar

style

>

<

body

>

<

div

id="box"

>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

div>

body

>

html

>

方法二, 利用內外層巢狀, 模擬, 相容所有瀏覽器, 相對於方法一比較麻煩, 使用時不能對滾動條宣告任何樣式

doctype html

>

<

html

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>超出部分滾動條

title

>

head

>

<

style

type

="text/css"

>

#box

#box > div

style

>

<

body

>

<

div

id="box"

>

<

div>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

你好 br

>你好

br>

div>

div>

body

>

html

>

另參考:

HTML 隱藏滾動條和去除滾動條的方法

1.html 標籤加屬性 xml html code複製內容到剪貼簿 htmllang en class no ie style overflow hidden 2.body中加入以下 xml html code複製內容到剪貼簿 styletype text css html html頁面去除滾動條...

HTML中滑鼠滾輪事件onmousewheel

ie opera屬於同一型別,使用attachevent即可新增滾輪事件。ie註冊事件 if document.attachevent firefox使用addeventlistener新增滾輪事件 firefox註冊事件 if document.addeventlistener safari與ch...

滑鼠滾輪控制panel滾動條

在winform開發中,通過設定panel的autoscroll屬性來控制滾動條是否顯示,但顯示滾動條的時候,滑鼠的滾輪是無法控制panel裡面的滾動條的,只能控制form的滾動條,當我們需要控制panel的滾動條的時候,應該怎麼做呢?1 拖乙個panel到form裡面,修改name為panel1,...