搜尋
首頁web前端html教學HTML 中的遊標

HTML 中的遊標

Sep 04, 2024 pm 04:53 PM
htmlhtml5HTML TutorialHTML PropertiesHTML tags

HTML 屬性中的遊標透過使用特定類型的遊標屬性來控制遊標懸停在任何 HTML 元素上時的形狀或外觀和感覺。這個概念僅適用於任何有遊標和滑鼠的設備;如果沒有,此功能可能會產生與遊標屬性相關的任何結果。此遊標屬性的目的是使用圖像在任何表單上提交按鈕。每當最終用戶將滑鼠懸停在圖像上時,如果這是一個提交按鈕,它會透過點擊它自動向您提供該圖像正在用作按鈕的線索。

遊標屬性在 HTML 中如何運作?

HTML 遊標屬性是基於 HTML 標籤內的樣式屬性工作。我們將研究 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 中的遊標
s-調整大小 HTML 中的遊標
w-調整大小 HTML 中的遊標
重新調整大小 HTML 中的遊標
西北調整大小 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: 



<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>


<div class="div2">
<h3 id="Progress-Cursor-Demo">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 id="Help-Cursor-Demo">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 id="Pointer-Cursor-Demo">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 id="Wait-Cursor-Demo">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>

Output:

HTML 中的遊標

Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.

Example #2

Selection showing cursors

Code:



<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>


<div class="div2">
<h3 id="Cross-hair-Cursor-Demo">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 id="Horizontal-Text-Cursor-Demo">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 id="Vertical-Text-Cursor-Demo">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>

Output:

HTML 中的遊標

Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.

Example #3

Drag and drop showing cursors.

Code:



<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>


<div class="div2">
<h3 id="Alias-Cursor-Demo">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 id="Copy-Cursor-Demo">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 id="Move-Cursor-Demo">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 id="No-drop-Cursor-Demo">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 id="Grab-Cursor-Demo">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 id="Not-allowed-Cursor-Demo">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>

Output:

HTML 中的遊標

HTML 中的遊標

Explanation: In the above output, click any paragraph for seeing the corresponding cursor output.

Example #4

Selection showing cursors.

Code:



<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>


<div class="div2">
<h3 id="Zoom-in-Cursor-Demo">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 id="Zoom-out-Cursor-Demo">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>

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中文網其他相關文章!

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
HTML的目的:啟用Web瀏覽器可以顯示內容HTML的目的:啟用Web瀏覽器可以顯示內容May 03, 2025 am 12:03 AM

HTML的核心目的在於讓瀏覽器理解並展示網頁內容。 1.HTML通過標籤定義網頁結構和內容,如、到、等。 2.HTML5增強了多媒體支持,引入了和標籤。 3.HTML提供了表單元素,支持用戶交互。 4.優化HTML代碼可提升網頁性能,如減少HTTP請求和壓縮HTML。

為什麼HTML標籤對Web開發很重要?為什麼HTML標籤對Web開發很重要?May 02, 2025 am 12:03 AM

htmltagsareessentialforwebdevelopmentastheyandendenhancewebpages.1)semantictagsimproveaccessibilityandseo.2)semanteLayOut,語義和互動性。 3)poseriblesibilityandseoandseo.3)poseriblesoftagscanoftagscanoftagscanoptagscanoptimizeperefeneandimizeanDenSuroceRecRoscRoss-BrowserCrowserCercerComercompatibility。

說明將一致的編碼樣式用於HTML標籤和屬性的重要性。說明將一致的編碼樣式用於HTML標籤和屬性的重要性。May 01, 2025 am 12:01 AM

一致的HTML編碼風格很重要,因為它提高了代碼的可讀性、可維護性和效率。 1)使用小寫標籤和屬性,2)保持一致的縮進,3)選擇並堅持使用單引號或雙引號,4)避免在項目中混合使用不同風格,5)利用自動化工具如Prettier或ESLint來確保風格的一致性。

如何在 Bootstrap 4 中實現多項目輪播?如何在 Bootstrap 4 中實現多項目輪播?Apr 30, 2025 pm 03:24 PM

在Bootstrap4中實現多項目輪播的解決方案在Bootstrap4中實現多項目輪播並不是一件簡單的事情。雖然Bootstrap...

deepseek官網是如何實現鼠標滾動事件穿透效果的?deepseek官網是如何實現鼠標滾動事件穿透效果的?Apr 30, 2025 pm 03:21 PM

如何實現鼠標滾動事件穿透效果?在我們瀏覽網頁時,經常會遇到一些特別的交互設計。比如在deepseek官網上,�...

HTML 視頻的播放控件樣式怎麼修改HTML 視頻的播放控件樣式怎麼修改Apr 30, 2025 pm 03:18 PM

無法直接通過CSS修改HTML視頻的默認播放控件樣式。 1.使用JavaScript創建自定義控件。 2.通過CSS美化這些控件。 3.考慮兼容性、用戶體驗和性能,使用庫如Video.js或Plyr可簡化過程。

在手機上使用原生select會帶來哪些問題?在手機上使用原生select會帶來哪些問題?Apr 30, 2025 pm 03:15 PM

在手機上使用原生select的潛在問題在開發移動端應用時,我們常常會遇到選擇框的需求。通常情況下,開發者傾...

在手機上使用原生select的弊端是什麼?在手機上使用原生select的弊端是什麼?Apr 30, 2025 pm 03:12 PM

在手機上使用原生select的弊端是什麼?在移動設備上開發應用時,選擇合適的UI組件是非常重要的。許多開發者�...

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

Atom編輯器mac版下載

Atom編輯器mac版下載

最受歡迎的的開源編輯器

VSCode Windows 64位元 下載

VSCode Windows 64位元 下載

微軟推出的免費、功能強大的一款IDE編輯器

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)