2017-09-24 75 views
0

所以,我想知道如何通過style HTML元素屬性將光標設置爲指針。基本上,你將如何改變style屬性來做一些事情,然後將它們放在cursor: pointer;而不是實際的CSS文件(內部/外部)中。如何通過HTML屬性將光標設置爲指針

+0

你設置它像你將任何其他財產的風格屬性?是什麼讓你覺得它會和遊標屬性有什麼不同? – BoltClock

+0

@BoltClock我懷疑你需要有一個':hover'的種類。 – CyanCoding

+0

啊,我不得不承認,懸停系統是否有所作爲並沒有明確的答案 - 現在已經問了很多次,沒有明確的答案(IE6支持除外)。至少在絕大多數用例中,它似乎沒有什麼區別,所以你可能不必擔心它。 (如果你確實需要指定一個僞類,[你會不走運](https://stackoverflow.com/questions/5293280/css-pseudo-classes-with-inline-styles)。) – BoltClock

回答

0

下面是語法,並且您可以指定指針形狀的一些例子:

<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:grab">grab</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> 
<span style="cursor:not-allowed">not-allowed</span><br> 
<span style="cursor:no-drop">no-drop</span><br>