Home >Web Front-end >CSS Tutorial >Detailed explanation of css cursor url usage format
css cursor url usage format: css:{cursor:url('icon path'),auto;} //IE, FF, chrome browsers are all available
Example code: html{cursor: url("http:// ued.taobao.com/blog/wp-content/themes/taobaoued/images/cursor.ico"),auto;}
Analysis: The previous url is a custom mouse icon path, and the second parameter auto is css standard The cursor style can be replaced by other attributes (such as pointer/default, etc.)!
(Note: w3school recommends that the second parameter must define a common cursor, in case the available cursor defined by the URL is available as a backup! In addition, the second parameter can be omitted in IE)
Customize the mouse display icon, required Pay attention to the following issues
Icon format:
IE supports cur, ani, and ico formats. FF supports bmp, gif, jpg, cur, and ico formats. It does not support ani format or gif. Animation format, so it is generally better to save the image referenced by the URL in ico or cur format!
Icon size:
The recommended size of the mouse image is 32*32, otherwise it may cause inconsistent icon sizes!
In addition, for the problem that the mouse image is not displayed in the browser, the problem mostly lies in the reference to the URL path of the mouse image. You can try the absolute and relative path references respectively.
Finally, the possible values of the cursor attribute are attached: (All major browsers support the following cursor attributes)