HTMLのカーソル
HTML プロパティのカーソルは、特定の種類のカーソル プロパティを使用して、HTML 要素上にカーソルを置いたときのカーソルの形状や外観を制御します。この概念は、カーソルとマウスを備えたデバイスにのみ適用されます。そうでない場合、この機能はカーソル プロパティを使用して関連する結果を返す可能性があります。このカーソル プロパティの目的は、フォーム上でボタンを送信するために画像を使用することです。エンドユーザーが画像の上にマウスを移動すると、それが送信ボタンの場合は、クリックすることで画像がボタンとして機能していることが自動的にわかります。
HTML では Cursor プロパティはどのように機能しますか?
HTML カーソル プロパティは、HTML タグ内の style プロパティに基づいて機能します。 HTML のいくつかの異なるカーソル構文を調査します。
構文 #1
<span style="cursor:auto">auto</span>
構文 #2
<span style="cursor:crosshair">crosshair</span>
構文 #3
<span style="cursor:default">default</span>
構文 #4
<span style="cursor:e-resize">e-resize</span>
構文 #5
<span style="cursor:help">help</span>
構文 #6
<span style="cursor:move">move</span>
構文 #7
<span style="cursor:n-resize">n-resize</span>
構文 #8
<span style="cursor:ne-resize">ne-resize</span>
構文 #9
<span style="cursor:nw-resize">nw-resize</span>
構文 #10
<span style="cursor:pointer">pointer</span>
構文 #11
<span style="cursor:progress">progress</span>
構文 #12
<span style="cursor:s-resize">s-resize</span>
構文 #13
<span style="cursor:se-resize">se-resize</span>
構文 #14
<span style="cursor:sw-resize">sw-resize</span>
構文 #15
<span style="cursor:text">text</span>
構文 #16
<span style="cursor:w-resize">w-resize</span>
構文 #17
<span style="cursor:wait">wait</span>
Cursor Values and its Description Table
Type | HTML Value | How Cursor Look Like? | Description | |||||
General | auto | Based on the text cursor will change automatically. | ||||||
default | ![]() |
By default, an arrow cursor. | ||||||
none | No cursor is displayed. | |||||||
Links & Status | context-menu | ![]() |
Cursor like context menu | |||||
help | ![]() |
Help information with an arrow question mark. | ||||||
pointer | ![]() |
Pointer symbol with a hand like a cursor. | ||||||
progress | ![]() |
Says program is busy and can able to interact with the application. | ||||||
wait | ![]() |
Says program is busy and cannot able to interact with the application. | ||||||
Selection | cell | ![]() |
Cells can be selected from the table showing the cursor. | |||||
crosshair | ![]() |
Cross cursor used for selection. | ||||||
text | ![]() |
An I-beam cursor used for the selected text. | ||||||
vertical-text | ![]() |
A sideway I-beam cursor used for the vertical selected text. | ||||||
Drag & Drop | alias | ![]() |
shortcut cursor | |||||
copy | ![]() |
Copied cursor | ||||||
move | ![]() |
the element can be moved with the cursor. | ||||||
no-drop |
|
항목이 삭제되지 않고 커서가 표시됩니다. | ||||||
불가 | ![]() |
요청은 커서 작업을 앞으로 진행할 수 없습니다. | ||||||
잡기 | ![]() |
잡은 커서 | ||||||
잡기 | ![]() |
뭔가 커서를 움켜쥐고 있습니다. | ||||||
크기 조정 및 스크롤 | 전체 스크롤 |
|
![]() |
|||||
특정 방향으로 스크롤하면 커서가 표시됩니다. |
![]() |
|||||||
항목/열의 크기를 가로로 조정할 수 있습니다.![]() |
||||||||
항목/열의 크기를 세로로 조정할 수 있습니다.![]() |
||||||||
커서를 표시하는 특정 표시된 방향으로 이동한 모든 가장자리.![]() |
||||||||
전자 크기 조정 |
![]() |
|||||||
크기 조정 |
![]() |
|||||||
w-크기 조정 |
![]() |
|||||||
크기 조정 |
![]() |
|||||||
nw-크기 조정 |
![]() |
|||||||
크기 조정 |
![]() |
|||||||
sw-크기 조정 |
![]() |
새 크기 조정 | ||||||
양방향 크기 조정 커서.![]() |
||||||||
ns-크기 조정 |
![]() |
|||||||
새 크기 조정 |
![]() |
|||||||
nwse-크기 조정 |
![]() |
확대 | ||||||
커서가 보이는 확대 및 축소![]() |
Examples to Implement Cursor in HTML
Below are the examples mentioned:
Example #1
Links and Status showing cursors.
Code:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Cursors in HTML</title> <style type="text/css"> .div2 { border: 1px solid brown; color: green; width: 900px; font-size: 20px; } .div3 { border: 1px solid brown; color: red; width: 900px; font-size: 20px; } .div4 { border: 1px solid brown; color: blue; width: 900px; font-size: 20px; } .div5 { border: 1px solid brown; color: lime; width: 900px; font-size: 20px; } </style> </head> <body> <div class="div2"> <h3 style="text-align: center">Progress Cursor Demo</h3> <span style="cursor: progress">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div3"> <h3 style="text-align: center">Help Cursor Demo</h3> <span style="cursor: help">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div4"> <h3 style="text-align: center">Pointer Cursor Demo</h3> <span style="cursor: pointer">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div5"> <h3 style="text-align: center">Wait Cursor Demo</h3> <span style="cursor: wait">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> </html>
Output:
Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.
Example #2
Selection showing cursors
Code:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Cursors in HTML</title> <style type="text/css"> .div2 { border: 1px solid blue; color: fuchsia; width: 900px; font-size: 20px; } .div3 { border: 1px solid blue; color: gray; width: 900px; font-size: 20px; } .div4 { border: 1px solid blue; color: maroon; width: 900px; font-size: 20px; } </style> </head> <body> <div class="div2"> <h3 style="text-align: center">Cross hair Cursor Demo</h3> <span style="cursor: crosshair">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div3"> <h3 style="text-align: center">Horizontal Text Cursor Demo</h3> <span style="cursor: text">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div4"> <h3 style="text-align: center">Vertical Text Cursor Demo</h3> <span style="cursor: vertical-text">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> </html>
Output:
Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.
Example #3
Drag and drop showing cursors.
Code:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Cursors in HTML</title> <style type="text/css"> .div2 { border: 1px solid red; color: orange; width: 900px; font-size: 20px; } .div3 { border: 1px solid red; color: olive; width: 900px; font-size: 20px; } .div4 { border: 1px solid red; color: navy; width: 900px; font-size: 20px; } .div5 { border: 1px solid red; color: lime; width: 900px; font-size: 20px; } .div6 { border: 1px solid red; color: blue; width: 900px; font-size: 20px; } .div7 { border: 1px solid red; color: maroon; width: 900px; font-size: 20px; } </style> </head> <body> <div class="div2"> <h3 style="text-align: center">Alias Cursor Demo</h3> <span style="cursor: alias">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div3"> <h3 style="text-align: center">Copy Cursor Demo</h3> <span style="cursor: copy">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div4"> <h3 style="text-align: center">Move Cursor Demo</h3> <span style="cursor: move">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div5"> <h3 style="text-align: center">No-drop Cursor Demo</h3> <span style="cursor: no-drop">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div6"> <h3 style="text-align: center">Grab Cursor Demo</h3> <span style="cursor: grab">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div7"> <h3 style="text-align: center">Not-allowed Cursor Demo</h3> <span style="cursor: not-allowed">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> </html>
Output:
Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.
Example #4
Selection showing cursors.
Code:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Cursors in HTML</title> <style type="text/css"> .div2 { border: 1px solid fuchsia; color: teal; width: 900px; font-size: 20px; } .div3 { border: 1px solid fuchsia; color: purple; width: 900px; font-size: 20px; } </style> </head> <body> <div class="div2"> <h3 style="text-align: center">Zoom-in Cursor Demo</h3> <span style="cursor: zoom-in">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> <br> <div class="div3"> <h3 style="text-align: center">Zoom-out Cursor Demo</h3> <span style="cursor: zoom-out">Cursor in HTML property controls shape or look and feel of the cursor when it is hovering on the any HTML element by using specific type of cursor property.</span> </div> </html>
Output:
Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.
Conclusion
Cursor property works based on property value given to the cursor. Based on the requirement, we choose which cursor action required at the instant.
以上がHTMLのカーソルの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック











HTML の表の境界線に関するガイド。ここでは、HTML でのテーブルの境界線の例を示しながら、テーブル境界線を定義する複数の方法について説明します。

これは、HTML でのネストされたテーブルのガイドです。ここでは、テーブル内にテーブルを作成する方法をそれぞれの例とともに説明します。

HTML マージン左のガイド。ここでは、HTML margin-left の概要とその例、およびそのコード実装について説明します。

HTML テーブル レイアウトのガイド。ここでは、HTML テーブル レイアウトの値と例および出力について詳しく説明します。

HTML 入力プレースホルダーのガイド。ここでは、コードと出力とともに HTML 入力プレースホルダーの例について説明します。

HTML オンクリック ボタンのガイド。ここでは、それらの紹介、動作、例、およびさまざまなイベントでの onclick イベントについてそれぞれ説明します。

HTML でのテキストの移動に関するガイド。ここでは、概要、マーキー タグが構文でどのように機能するか、および実装例について説明します。
