Summary of CSS-cursor properties and usage

零下一度
Release: 2017-06-09 11:36:34
Original
3251 people have browsed it

The cursor attribute specifies the type (shape) of the cursor to be displayed. This property defines the cursor shape used when the mouse pointer is placed within the bounds of an element (although CSS2.1 does not define which bounds determine this range).

When we layout DIV CSS, we will encounter the control of the mouse pointer cursor within the object, such as the mouse passing through the pointer and changing into a finger shape. Next, we introduce the mouse pointer style cursor control. In addition to the system default mouse pointer style, you can set the image as the mouse pointer through CSS. It is common for some websites to have various small image styles for the mouse pointer. Of course, this is to set the mouse style through css cursor.

1.CSS-cursor attribute

The cursor attribute specifies the type (shape) of the cursor to be displayed

Summary of CSS-cursor properties and usage

2.Detailed explanation of css cursor url usage format

css cursor url usage format: css:{cursor:url('icon path'),auto;} //IE,FF,chrome All browsers can

Example code:

html{cursor: url("ued.taobao.com/blog/wp-content/themes/taobaoued/images/cursor.ico"),auto;}
Copy after login

Analysis: The previous url is a custom mouse icon path, and the second parameter auto is the css standard cursor style, which can be replaced by other attributes ( Such as pointer/default, etc.)!

3.cursor mouse style?

auto: normal mouse

crosshair: crosshair mouse

default: default mouse

pointer: point mouse (hand, two are written to take care of IE5, which only recognizes hand.)

move: move the mouse

4.About cursor settings Image issues

Several things to note: 1. The image address is an absolute path, 2. The image size is best 32*32, anyway, the size parsed under each browser is different.

5.css cursor mouse shape

url The URL of the custom cursor to be used.

Note: Always define a normal cursor at the end of this list in case there is no available cursor defined by URL.

default Default cursor (usually an arrow)

auto Default. The cursor set by the browser.

crosshair The cursor appears as a crosshair.

pointer The cursor appears as a pointer (a hand) indicating a link.

move This cursor indicates that an object can be moved.

6.Detailed explanation of the example code of cursor attribute in CSS

cursor attribute of CSS

Today I learned the cursor attribute of CSS. This is my first blog Let's sum it up.

The cursor attribute is used to control the display style of the cursor. The possible values are as follows:

cursor:url()*| {auto|default|pointer|crosshair|text|vertical-text|help|not-allowed|no-drop|move|e-reszie|s-resize|w-resize|w-resize|n-resize|all-scroll|ne-resize|se-resize|nw-resize|sw-resize|col-resize|row-resize|}
Copy after login

* means writing at least one of this value, and you can select a value in {} after the url.

Related questions and answers:

1.javascript - After binding the window.resize event to an element, the cursor attribute set previously Failed.

2.vim - Mapping in visual mode to achieve cursor switching between split windows?

[Related recommendations 】

1.php.cn Dugu Jiujian (2) - css video tutorial

2.Position the mouse focus to the end of the text box

The above is the detailed content of Summary of CSS-cursor properties and usage. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!