使用CSS旋转鼠标光标图标

时间:2014-01-13 09:11:43

标签: css rotation resize cursor

我有一个可以调整大小和旋转的对象。

可以使用8个不同的“手柄”调整对象的大小:s,se,ne,n,nw,w,se 我已将光标设置在带有内置游标的句柄上:s_resize,n_resize等。

问题是当旋转对象时,调整大小光标不会反映调整大小手柄的方向。

我需要做的是以某种方式按对象的角度旋转光标。

是否有一些方法使用CSS来做到这一点?

我讨厌为每个角度使用自定义光标图标......

1 个答案:

答案 0 :(得分:1)

东北,西北,东南和西南也有标准游标:

cursor: ne-resize (an arrow pointing northeast)
cursor: nw-resize (an arrow pointing northwest)
cursor: se-resize (an arrow pointing southeast)
cursor: sw-resize (an arrow pointing southwest)

请参阅http://www.htmlgoodies.com/beyond/css/article.php/3470321

如果这些足够好我恐怕你可能不得不使用自定义图像作为图标,例如:

.custom {
   cursor: url(images/my-cursor.png), auto;
}