互動性
用於控制滑鼠懸停在元素上時的游標樣式的工具類。
類別 | 樣式 |
---|---|
cursor-auto | cursor: auto; |
cursor-default | cursor: default; |
cursor-pointer | cursor: pointer; |
cursor-wait | cursor: wait; |
cursor-text | cursor: text; |
cursor-move | cursor: move; |
cursor-help | cursor: help; |
cursor-not-allowed | cursor: not-allowed; |
cursor-none | cursor: none; |
cursor-context-menu | cursor: context-menu; |
cursor-progress | cursor: progress; |
cursor-cell | cursor: cell; |
cursor-crosshair | cursor: crosshair; |
cursor-vertical-text | cursor: vertical-text; |
cursor-alias | cursor: alias; |
cursor-copy | cursor: copy; |
cursor-no-drop | cursor: no-drop; |
cursor-grab | cursor: grab; |
cursor-grabbing | cursor: grabbing; |
cursor-all-scroll | cursor: all-scroll; |
cursor-col-resize | cursor: col-resize; |
cursor-row-resize | cursor: row-resize; |
cursor-n-resize | cursor: n-resize; |
cursor-e-resize | cursor: e-resize; |
cursor-s-resize | cursor: s-resize; |
cursor-w-resize | cursor: w-resize; |
cursor-ne-resize | cursor: ne-resize; |
cursor-nw-resize | cursor: nw-resize; |
cursor-se-resize | cursor: se-resize; |
cursor-sw-resize | cursor: sw-resize; |
cursor-ew-resize | cursor: ew-resize; |
cursor-ns-resize | cursor: ns-resize; |
cursor-nesw-resize | cursor: nesw-resize; |
cursor-nwse-resize | cursor: nwse-resize; |
cursor-zoom-in | cursor: zoom-in; |
cursor-zoom-out | cursor: zoom-out; |
cursor-(<custom-property>) | cursor: var(<custom-property>); |
cursor-[<value>] | cursor: <value>; |
使用像cursor-pointer
和cursor-grab
這樣的工具類來控制滑鼠懸停在元素上時顯示的游標
將滑鼠懸停在每個按鈕上以查看游標的變化
<button class="cursor-pointer ...">Submit</button><button class="cursor-progress ...">Saving...</button><button class="cursor-not-allowed ..." disabled>Confirm</button>
使用 cursor-[<value>]
語法 來設定cursor基於完全自訂的值
<button class="cursor-[url(hand.cur),_pointer] ..."> <!-- ... --></button>
對於 CSS 變數,您也可以使用 cursor-(<custom-property>)
語法
<button class="cursor-(--my-cursor) ..."> <!-- ... --></button>
這只是 cursor-[var(<custom-property>)]
的一個簡寫,它會自動為您新增 var()
函式。
為cursor
工具類別 新增前綴 加上像md:
這樣的斷點變體,以便僅在中等尺寸 螢幕尺寸及以上套用此工具類別
<button class="cursor-not-allowed md:cursor-auto ..."> <!-- ... --></button>
瞭解更多關於在變體文件中使用變體的資訊。