css設(shè)置鼠標(biāo)光標(biāo)形狀的方法:可以利用cursor屬性來(lái)進(jìn)行設(shè)置,如【<span style="cursor:crosshair">crosshair</span>】,表示將光標(biāo)設(shè)置為十字線形狀。
本文操作環(huán)境:windows10系統(tǒng)、css 3、thinkpad t480電腦。
屬性介紹:
cursor屬性定義了鼠標(biāo)指針?lè)旁谝粋€(gè)元素邊界范圍內(nèi)時(shí)所用的光標(biāo)形狀。
常用屬性值:
-
text 此光標(biāo)指示文本。
-
wait 此光標(biāo)指示程序正忙(通常是一只表或沙漏)。
-
help 此光標(biāo)指示可用的幫助(通常是一個(gè)問(wèn)號(hào)或一個(gè)氣球)。
-
auto 默認(rèn)。瀏覽器設(shè)置的光標(biāo)。
-
crosshair 光標(biāo)呈現(xiàn)為十字線。
-
pointer 光標(biāo)呈現(xiàn)為指示鏈接的指針(一只手)
設(shè)置鼠標(biāo)光標(biāo)形狀的方法:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)</title> </head> <body> <p>請(qǐng)把鼠標(biāo)移動(dòng)到單詞上,可以看到鼠標(biāo)指針發(fā)生變化:</p> <span style="cursor:auto">auto</span><br> <span style="cursor:crosshair">crosshair</span><br> <span style="cursor:default">default</span><br> <span style="cursor:e-resize">e-resize</span><br> <span style="cursor:help">help</span><br> <span style="cursor:move">move</span><br> <span style="cursor:n-resize">n-resize</span><br> <span style="cursor:ne-resize">ne-resize</span><br> <span style="cursor:nw-resize">nw-resize</span><br> <span style="cursor:pointer">pointer</span><br> <span style="cursor:progress">progress</span><br> <span style="cursor:s-resize">s-resize</span><br> <span style="cursor:se-resize">se-resize</span><br> <span style="cursor:sw-resize">sw-resize</span><br> <span style="cursor:text">text</span><br> <span style="cursor:w-resize">w-resize</span><br> <span style="cursor:wait">wait</span><br> </body> </html>
相關(guān)學(xué)習(xí):CSS教程