多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

中國最全I(xiàn)T社區(qū)平臺(tái) 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2

css教程

CSS 教程

CSS 響應(yīng)式設(shè)計(jì)

CSS實(shí)例

拓展閱讀

css鼠標(biāo)樣式語法及20種可選值(屬性)

閱讀 (2340)

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


用css控制鼠標(biāo)樣式的語法如下:

<span style="cursor:*">文本或其它頁面元素</span>

把 * 換成如下20個(gè)可選值的一種:

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

crosshair;


十字準(zhǔn)心

The cursor render as a crosshair
游標(biāo)表現(xiàn)為十字準(zhǔn)線

cursor: pointer; 
cursor: hand;
寫兩個(gè)是為了照顧IE5,它只認(rèn)hand。

 

The cursor render as a pointer (a hand) that indicates a link
游標(biāo)以暗示(手指)的形式來表明有一個(gè)連接

cursor: wait;

 

等待/沙漏

The cursor indicates that the program is busy (often a watch or an hourglass)
游標(biāo)暗示當(dāng)前程序正忙(一般為一塊表或是一個(gè)沙漏)

cursor: help;

 

幫助

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

cursor: no-drop;

 

無法釋放

cursor: no-drop;

cursor: text;

 

文字/編輯

The cursor indicates text
游標(biāo)暗示當(dāng)前所處位置為文字內(nèi)容

cursor: move;

 

可移動(dòng)對(duì)象

The cursor indicates something that should be moved
游標(biāo)暗示一些東西應(yīng)該被移動(dòng)

cursor: n-resize;

 

向上改變大小(North)

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

cursor: s-resize;

 

向下改變大小(South)

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

cursor: e-resize;

 

向右改變大小(East)

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

cursor: w-resize;

向左改變大小(West)

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

cursor: ne-resize;

 

向上右改變大小(North East)

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

cursor: nw-resize;

 

向上左改變大小(North West)

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

cursor: se-resize;

 

向下右改變大小(South East)

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

cursor: sw-resize;

 

向下左改變大小(South West)

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

cursor: auto;

 

自動(dòng)

The browser sets a cursor
瀏覽器設(shè)置一個(gè)游標(biāo)

cursor:not-allowed;

 

禁止

cursor:not-allowed;

cursor: progress;

 

處理中

cursor: progress;

cursor: default;

 

系統(tǒng)默認(rèn)

The default cursor (often an arrow)
默認(rèn)的游標(biāo)狀態(tài)(通常為一個(gè)箭頭)

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

 

用戶自定義(可用動(dòng)畫)

The url of a custom cursor to be used.
自定義游標(biāo)的url位置

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


cursor的pointer與hand區(qū)別

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

用瀏覽器測(cè)試得出以下結(jié)論:
cursor:hand :IE完全支持。但是在firefox是不支持的,沒有效果。
cursor:pointer :是CSS2.0的標(biāo)準(zhǔn)。所以firefox是支持的,但是IE5.0既之前版本不支持。IE6開始支持。
所以為了兼容各個(gè)主流瀏覽器,盡量使用cursor:pointer,而不要使用cursor:hand。

實(shí)例:

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>cursor屬性</title>
    <style type="text/css">
        div
        {
            width:100px;
            height:30px;
            line-height:30px;
            text-align:center;
            border:1px solid #CCCCCC;
            background-color: #40B20F;
            color:white;
            font-size:14px;
            font-weight:bold;
        }
        #div_default{cursor:default;}
        #div_pointer{cursor:pointer;}
    </style>
</head>
<body>
    <div id="div_default">鼠標(biāo)默認(rèn)樣式</div>
    <div id="div_pointer">鼠標(biāo)手狀樣式</div>
</body>
</html>
在瀏覽器預(yù)覽效果如下:

css鼠標(biāo)樣式

CSS Cursor鼠標(biāo)指針樣式兼容性參考表

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

CSS Cursor兼容表




關(guān)閉
程序員人生
主站蜘蛛池模板: 欧美大屁股精品毛片视频 | 国产香蕉一区二区在线网站 | h免费在线 | 天天狠狠| 亚洲国产网站 | 全亚洲最大的免费影院 | 中文字幕一区二区三区精彩视频 | 日本中文字幕一区二区有码在线 | www.啪| 亚洲国产精品久久精品成人 | 国产美女亚洲精品久久久毛片 | 中文字幕亚洲在线 | 成人免费的性色视频 | 久久精品在线 | free性video另类重口 | 国产日韩精品一区二区在线观看播放 | 久久大香线蕉综合爱 | 久久久久久久国产a∨ | 最近中文字幕mv免费视频 | 日本高清wwww免费视频 | 日韩欧美亚洲一区二区综合 | 天堂欧美 | 国产婷婷综合在线视频 | 午夜影院免费入口 | 国产精品热久久毛片 | 亚洲精品久久片久久 | 日本护士xxxx黑人巨大 | 三级视频在线 | 天堂最新版www在线观看 | 亚洲在线天堂 | 日韩中文字幕一区二区不卡 | 亚洲亚洲人成网站在线观看 | 国产福利片在线 | 久久免费毛片 | 欧美freesex呦交6_10 | 国产精品第一页第一页 | 欧美日韩一区二区三区视频在线观看 | 日本一区视频在线观看 | 叼嘿视频在线观看免费 | 五月天在线观看免费视频播放 | 男人午夜网站 |