HTMLのカーソル

WBOY
リリース: 2024-09-04 16:53:24
オリジナル
921 人が閲覧しました

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

열 크기 조정행 크기 조정n-크기 조정
Type HTML Value How Cursor Look Like? Description
General auto Based on the text cursor will change automatically.
default HTMLのカーソル By default, an arrow cursor.
none No cursor is displayed.
Links & Status context-menu HTMLのカーソル Cursor like context menu
help HTMLのカーソル Help information with an arrow question mark.
pointer HTMLのカーソル Pointer symbol with a hand like a cursor.
progress HTMLのカーソル Says program is busy and can able to interact with the application.
wait HTMLのカーソル Says program is busy and cannot able to interact with the application.
Selection cell HTMLのカーソル Cells can be selected from the table showing the cursor.
crosshair HTMLのカーソル Cross cursor used for selection.
text HTMLのカーソル An I-beam cursor used for the selected text.
vertical-text HTMLのカーソル A sideway I-beam cursor used for the vertical selected text.
Drag & Drop alias HTMLのカーソル shortcut cursor
copy HTMLのカーソル Copied cursor
move HTMLのカーソル the element can be moved with the cursor.
no-drop
HTMLのカーソル
항목이 삭제되지 않고 커서가 표시됩니다.
불가 HTMLのカーソル 요청은 커서 작업을 앞으로 진행할 수 없습니다.
잡기 HTMLのカーソル 잡은 커서
잡기 HTMLのカーソル 뭔가 커서를 움켜쥐고 있습니다.
크기 조정 및 스크롤 전체 스크롤
HTMLのカーソル
HTMLのカーソル
특정 방향으로 스크롤하면 커서가 표시됩니다. HTMLのカーソル
항목/열의 크기를 가로로 조정할 수 있습니다.HTMLのカーソル
항목/열의 크기를 세로로 조정할 수 있습니다.HTMLのカーソル
커서를 표시하는 특정 표시된 방향으로 이동한 모든 가장자리.HTMLのカーソル
전자 크기 조정 HTMLのカーソル
크기 조정 HTMLのカーソル
w-크기 조정 HTMLのカーソル
크기 조정 HTMLのカーソル
nw-크기 조정 HTMLのカーソル
크기 조정 HTMLのカーソル
sw-크기 조정 HTMLのカーソル 새 크기 조정
양방향 크기 조정 커서.HTMLのカーソル
ns-크기 조정 HTMLのカーソル
새 크기 조정 HTMLのカーソル
nwse-크기 조정 HTMLのカーソル확대/축소 확대
커서가 보이는 확대 및 축소HTMLのカーソル
축소

 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:

HTMLのカーソル

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:

HTMLのカーソル

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:

HTMLのカーソル

HTMLのカーソル

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:

HTMLのカーソル

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 サイトの他の関連記事を参照してください。

ソース:php
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!