How we can change the mouse cursor point using HTML & CSS? Solution: CSS Custom Cursor Pointers, HTML CSS Cursor Icon Change.
I am sure that you know what is mouse cursor, If you don’t know then let me tell you when we move the mouse then an arrow starts moving that is mouse cursor. We can see many types of the cursor when we do different tasks, like round loading cursor, progressing cursor, etc.
Today you will learn to put custom cursor pointers in a webpage using CSS. Yes we can customize mouse cursor icon using CSS because CSS has a special property called cursor:
. There are so many cursor’s pointers you can apply with this CSS property. These all pointer’s icons very easy to apply, you just have to put a single line of CSS code for each.
So, Today I am sharing CSS Custom Cursor Pointers Example, Cursor Icon Change With HTML & CSS. I will show you 36 different mouse cursor icon of CSS. I have created 36 buttons to show all the cursor pointer, You just have to hover on the buttons to show change.
If you are thinking now how these all mouse pointer actually is, then see the preview given below.
Preview Of Cursor Pointers Icon Change
See this video preview to getting an idea of how this program works.
Now you can see all the pointer icon visually, maybe it is difficult to see on small screens. Don’t worry get the codes & try your own.
You May Also Like:
CSS Custom Cursor Pointers Source Code
Before sharing source code, let’s talk about it. I have created hyperlinks using <a>
tag, created them as buttons. Inside the hyperlink tag, I have created a span for text. I have used inline CSS for the cursor styles, like <span style="cursor:defult">
. And inside the span, I have also put the cursor’s style name to easily identify.
In the same way, I have put all the pointer icons style when you hover on the buttons then you will get the result. I have used a google font for texts are available inside the buttons. Also in the CSS file, I have done left other works, like positions, color, hover effect, etc. That’s all, You have to create only 2 files for creating this one for HTML & one for CSS.
Follow the steps to creating this without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
<!DOCTYPE html> <!-- code by webdevtrick ( https://webdevtrick.com ) --> <html> <head> <meta charset="UTF-8"> <title>CSS Cursor</title> <link href="https://fonts.googleapis.com/css?family=Russo+One&display=swap" rel="stylesheet"> <link rel="stylesheet" href="style.css" > </head> <body> <a class="button"> <span style="cursor:defult">defult</span> </a> <a class="button"> <span style="cursor:none">none</span> </a> <a class="button"> <span style="cursor:alias">alias</span> </a> <a class="button"> <span style="cursor:auto">auto</span> </a> <a class="button"> <span style="cursor:cell">cell</span> </a> <a class="button"> <span style="cursor:all-scroll">all-scroll</span> </a> <a class="button"> <span style="cursor:context-menu">context-menu</span> </a> <a class="button"> <span style="cursor:copy">copy</span> </a> <a class="button"> <span style="cursor:col-resize">col-resize</span> </a> <a class="button"> <span style="cursor:crosshair">crosshair</span> </a> <a class="button"> <span style="cursor:help">help</span> </a> <a class="button"> <span style="cursor:move">move</span> </a> <a class="button"> <span style="cursor:no-drop">no-drop</span> </a> <a class="button"> <span style="cursor:not-allowed">not-allowed</span> </a> <a class="button"> <span style="cursor:pointer">pointer</span> </a> <a class="button"> <span style="cursor:progress">progress</span> </a> <a class="button"> <span style="cursor:row-resize">row-resize</span> </a> <a class="button"> <span style="cursor:text">text</span> </a> <a class="button"> <span style="cursor:vertical-text">vertical-text</span> </a> <a class="button"> <span style="cursor:wait">wait</span> </a> <a class="button"> <span style="cursor:n-resize">n-resize</span> </a> <a class="button"> <span style="cursor:w-resize">w-resize</span> </a> <a class="button"> <span style="cursor:s-resize">s-resize</span> </a> <a class="button"> <span style="cursor:e-resize">e-resize</span> </a> <a class="button"> <span style="cursor:nw-resize">nw-resize</span> </a> <a class="button"> <span style="cursor:ne-resize">ne-resize</span> </a> <a class="button"> <span style="cursor:sw-resize">sw-resize</span> </a> <a class="button"> <span style="cursor:se-resize">se-resize</span> </a> <a class="button"> <span style="cursor:ew-resize">ew-resize</span> </a> <a class="button"> <span style="cursor:ns-resize">ns-resize</span> </a> <a class="button"> <span style="cursor:nesw-resize">nesw-resize</span> </a> <a class="button"> <span style="cursor:nwse-resize">nwse-resize</span> </a> <a class="button"> <span style="cursor:-webkit-zoom-in">zoom-in</span> </a> <a class="button"> <span style="cursor:-webkit-zoom-out">zoom-out</span> </a> <a class="button"> <span style="cursor:-webkit-grab">grab</span> </a> <a class="button"> <span style="cursor:-webkit-grabbing">grabbing</span> </a> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
/** code by webdevtrick ( https://webdevtrick.com ) **/ body { background: #FF6D70; height:100%; left:0px; position:absolute; top:0; } .button { display: inline-block; margin: 10px; border: 2px solid #333; border-radius: 15px; } .button span { background-color: #E8E8E8; border-radius: 15px; display: inline-block; padding: 10px 40px; color: #333; text-transform: uppercase; font-family: 'Russo One', sans-serif; font-weight: 700; font-size: 32px; } .button span:hover { background-color: #AFAFAF; color: #FFF; cursor: pointer; } |
That’s It. Now you have successfully created CSS Custom Cursor Pointers, HTML CSS Cursor Icon Change program. If you have any doubt or question comment down below.
Thanks For Visting, Keep Visiting.