CSS cursor 屬性
示例
CSS 可以生成一堆不同的滑鼠游標
.alias {cursor: alias;}
.all-scroll {cursor: all-scroll;}
.auto {cursor: auto;}
.cell {cursor: cell;}
.col-resize {cursor: col-resize;}
.context-menu {cursor: context-menu;}
.copy {cursor: copy;}
.crosshair {cursor: crosshair;}
.default {cursor: default;}
.e-resize {cursor: e-resize;}
.ew-resize {cursor: ew-resize;}
.grab {cursor: grab;}
.grabbing {cursor: grabbing;}
.help {cursor: help;}
.move {cursor: move;}
.n-resize {cursor: n-resize;}
.ne-resize {cursor: ne-resize;}
.nesw-resize {cursor: nesw-resize;}
.ns-resize {cursor: ns-resize;}
.nw-resize {cursor: nw-resize;}
.nwse-resize {cursor: nwse-resize;}
.no-drop {cursor: no-drop;}
.none {cursor: none;}
.not-allowed {cursor: not-allowed;}
.pointer {cursor: pointer;}
.progress {cursor: progress;}
.row-resize {cursor: row-resize;}
.s-resize {cursor: s-resize;}
.se-resize {cursor: se-resize;}
.sw-resize {cursor: sw-resize;}
.text {cursor: text;}
.url {cursor: url(myBall.cur),auto;}
.w-resize {cursor: w-resize;}
.wait {cursor: wait;}
.zoom-in {cursor: zoom-in;}
.zoom-out {cursor: zoom-out;}
自己動手試一試 »
定義和用法
cursor
屬性指定了當滑鼠指標懸停在一個元素上時要顯示的滑鼠游標。
瀏覽器支援
表中的數字指定了完全支援該屬性的第一個瀏覽器版本。
屬性 | |||||
---|---|---|---|---|---|
cursor | 5.0 | 5.5 | 4.0 | 5.0 | 9.6 |
CSS 語法
cursor: 值;
屬性值
值 | 描述 | 演示 |
---|---|---|
alias | 游標指示將要建立某物的別名 | 試一試 » |
all-scroll | 游標指示可以在任何方向上滾動 | 試一試 » |
auto | 預設。瀏覽器設定一個游標 | 試一試 » |
cell | 游標指示可以選擇一個單元格(或一組單元格) | 試一試 » |
col-resize | 游標指示列可以水平調整大小 | 試一試 » |
context-menu | 游標指示有可用的上下文選單 | 試一試 » |
copy | 游標指示某物將被複制 | 試一試 » |
crosshair | 游標呈現為十字線 | 試一試 » |
default | 預設游標 | 試一試 » |
e-resize | 游標指示框的邊緣將向右(東)移動 | 試一試 » |
ew-resize | 指示一個雙向調整大小的游標 | 試一試 » |
抓取 | 游標指示可以抓取某物 | 試一試 » |
正在抓取 | 游標指示可以抓取某物 | 試一試 » |
幫助 | 游標指示有幫助可用 | 試一試 » |
move | 游標指示某物將被移動 | 試一試 » |
n-resize | 游標指示框的邊緣將向上(北)移動 | 試一試 » |
ne-resize | 游標指示框的邊緣將向上和向右(北/東)移動 | 試一試 » |
nesw-resize | 指示一個雙向調整大小的游標 | 試一試 » |
ns-resize | 指示一個雙向調整大小的游標 | 試一試 » |
nw-resize | 游標指示框的邊緣將向上和向左(北/西)移動 | 試一試 » |
nwse-resize | 指示一個雙向調整大小的游標 | 試一試 » |
no-drop | 游標指示拖動的專案不能在此處放置 | 試一試 » |
none | 不為元素呈現游標 | 試一試 » |
not-allowed | 游標指示請求的操作將不會被執行 | 試一試 » |
pointer | 游標是一個指標,表示一個連結 | 試一試 » |
progress | 游標指示程式正忙(進行中) | 試一試 » |
row-resize | 游標指示行可以垂直調整大小 | 試一試 » |
s-resize | 游標指示框的邊緣將向下(南)移動 | 試一試 » |
se-resize | 游標指示框的邊緣將向下和向右(南/東)移動 | 試一試 » |
sw-resize | 游標指示框的邊緣將向下和向左(南/西)移動 | 試一試 » |
text | 游標指示可以選擇的文字 | 試一試 » |
URL | 一個逗號分隔的自定義游標 URL 列表。注意:請務必在列表末尾指定一個通用游標,以防所有 URL 定義的游標都無法使用 | 試一試 » |
vertical-text | 游標指示可以選擇的垂直文字 | 試一試 » |
w-resize | 游標指示框的邊緣將向左(西)移動 | 試一試 » |
wait | 游標指示程式正忙 | 試一試 » |
zoom-in | 游標指示可以放大某物 | 試一試 » |
zoom-out | 游標指示可以縮小某物 | 試一試 » |
initial | 將此屬性設定為其預設值。閱讀關於initial | |
inherit | 從其父元素繼承此屬性。閱讀關於inherit |
相關頁面
HTML DOM 參考:cursor 屬性