日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)CSS教程:css鼠標樣式語法及20種可選值(屬性)

我們對Windows各種各樣的鼠標樣式都不陌生,當鼠標移動到不同的地方時,當鼠標執(zhí)行不同的功能時,當系統(tǒng)處于不同的狀態(tài)時,都會使鼠標的形狀發(fā)生變化。而在網(wǎng)頁上往往只有當鼠標在超級鏈接上時才出現(xiàn)一個手形,在其它地方似乎沒有什么變化,同充滿動感的網(wǎng)頁顯得不怎么和諧。這里教大家用CSS來定義20種種鼠標樣式形狀。在CSS中,使用cursor屬性來定義鼠標的樣式。

用css控制鼠標樣式的語法如下:

文本或其它頁面元素

把 * 換成如下20個可選值的一種:

cursor屬性取值如下,默認值為default。大家可能會說,cursor屬性值這么多,怎么記呀?其實大家不用擔心,在實際開發(fā)中,我們一般只用到“default”和“pointer”這兩個屬性值,其他的一般都很少用得上。如果實在沒辦法還需要其他的,那就回來查這種表就行了。

crosshair;

十字準心

The cursor render as a crosshair

光標表現(xiàn)為十字準線

cursor: pointer; 
cursor: hand;
寫兩個是為了照顧IE5,它只認hand。

The cursor render as a pointer (a hand) that indicates a link

光標標以暗示(手指)的形式來表明有一個連接

cursor: wait;

等待/沙漏

The cursor indicates that the program is busy (often a watch or an hourglass)
光標暗示當前程序正忙(一般為一塊表或是一個沙漏)

cursor: help;

幫助

The cursor indicates that help is available (often a question mark or a balloon)
光標暗示當前位置可得到幫助(一般為問號或是氣球)

cursor: no-drop;

無法釋放

cursor: no-drop;

cursor: text;

文字/編輯

The cursor indicates text
光標暗示當前所處位置為文字內(nèi)容

cursor: move;

可移動對象

The cursor indicates something that should be moved
光標暗示一些東西應(yīng)該被移動

cursor: n-resize;

向上改變大小(North)

The cursor indicates that an edge of a box is to be moved up (north)
邊緣可向上移動(北)

cursor: s-resize;

向下改變大小(South)

The cursor indicates that an edge of a box is to be moved down (south)
邊緣可向下方移動(南)

cursor: e-resize;

向右改變大小(East)

The cursor indicates that an edge of a box is to be moved right (east)
box邊緣可向右(東)邊移動

cursor: w-resize;

向左改變大小(West)

The cursor indicates that an edge of a box is to be moved left (west)
邊緣可向左移動(西)

cursor: ne-resize;

向上右改變大小(North East)

The cursor indicates that an edge of a box is to be moved up and right (north/east)
光標暗示box的邊緣可向右上方移動(東北方向)

cursor: nw-resize;

向上左改變大小(North West)

The cursor indicates that an edge of a box is to be moved up and left (north/west)
邊緣可向左上方移動(西北)

cursor: se-resize;

向下右改變大小(South East)

The cursor indicates that an edge of a box is to be moved down and right (south/east)
邊緣可向右下方移動(東南)

cursor: sw-resize;

向下左改變大小(South West)

The cursor indicates that an edge of a box is to be moved down and left (south/west)
邊緣可向左下方移動(西南)

cursor: auto;

自動

The browser sets a cursor
瀏覽器設(shè)置一個光標

cursor:not-allowed;

禁止

cursor:not-allowed;

cursor: progress;

處理中

cursor: progress;

cursor: default;

系統(tǒng)默認

The default cursor (often an arrow)
默認的光標狀態(tài)(通常為一個箭頭)

cursor: url(' # ');
# = 光標文件地址      (注意文件格式必須為:.cur 或 .ani)。

用戶自定義(可用動畫)

The url of a custom cursor to be used.
自定義光標的url位置

Note: Always define a generic cursor at the end of the list in case none of the url-defined cursors can be used
注意:在定義完自定義的光標之后在末尾加上一般性的光標,以防那些url所定義的光標不能使用

cursor的pointer與hand區(qū)別

cursor:hand 與 cursor:pointer 的效果是一樣,都像手形光標。那為什么有兩個呢,這兩個有什么區(qū)別呢?

用瀏覽器測試得出以下結(jié)論:

cursor:hand :IE完全支持。但是在 firefox 是不支持的,沒有效果。

cursor:pointer :是 CSS2.0 的標準。所以 firefox 是支持的,但是 IE5.0 既之前版本不支持。IE6 開始支持。

所以為了兼容各個主流瀏覽器,盡量使用 cursor:pointer,而不要使用 cursor:hand。

實例:

實例

#div_default{cursor:default;}

#div_pointer{cursor:pointer;}

嘗試一下 ?
在瀏覽器預(yù)覽效果如下:

CSS Cursor鼠標指針樣式兼容性參考表

下面分享一個鼠標指針樣式兼容性在線參考表,
黑色圖標:表示該屬性兼容此瀏覽器。
灰色圖標:表示該屬性不兼容此瀏覽器。



網(wǎng)站欄目:創(chuàng)新互聯(lián)CSS教程:css鼠標樣式語法及20種可選值(屬性)
文章出自:http://m.5511xx.com/article/coshsdd.html