定義和用法
cursor 屬性規定要顯示的光標的類型(形狀)。
該屬性定義了鼠標指針放在一個元素邊界範圍內時所用的光標形狀(不過 CSS2.1 沒有定義由哪個邊界確定這個範圍)。
可能的值:
demo:
<html> <head> <style type="text/css"> span{ line-height: 30px; } </style> </head> <body> <p>請把鼠標移動到單詞上,可以看到鼠標指針發生變化:</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:pointer"> Pointer </span><br /> <span style="cursor:move"> Move </span><br /> <span style="cursor:e-resize"> e-resize </span><br /> <span style="cursor:ne-resize"> ne-resize </span><br /> <span style="cursor:nw-resize"> nw-resize </span><br /> <span style="cursor:n-resize"> n-resize </span><br /> <span style="cursor:se-resize"> se-resize </span><br /> <span style="cursor:sw-resize"> sw-resize </span><br /> <span style="cursor:s-resize"> s-resize </span><br /> <span style="cursor:w-resize"> w-resize </span><br /> <span style="cursor:text"> text </span><br /> <span style="cursor:wait"> wait </span><br /> <span style="cursor:help"> help </span> </body> </html>