Change the appearance of the cursor in CSS

Last update on April 8, 2009 08:28 AM by jak58
Published by jak58

Chance the appearance of yhe cursor with CSS






The cursor property allow you to change the appearance of the cursor on an element of a web page.
The client will automatically display the cursor on his computer that matches the type of cursor you choose.


Example


Example of a style as a cross of the cursor on the "body" of your page

body{
  cursor:crosshair;
}



One can of course give different styles to several elements of the same page
Example of a style as a cross on the "body" style decorated with a hourglass shape on the images and hand on the links.
body{
  cursor: crosshair;
}
img{
  cursor: wait;
}
a:link{
  cursor:  pointer;
}


List of possible attributes


Accepted by all browsers
  • Self: Appearance same as the default cursor on the tag that has the attribute does not change.
  • Default: Cursor default browser.
  • Pointer: Cursor shaped hand with his finger unfolded.
  • Text: Cursor text editing.
  • Help: Cursor help.
  • Wait: Wait Cursor
  • Progress: Slider progression.
  • Move: Cursor movement.
  • Crosshair: Cursor-shaped cross.



Cursors resizing
  • N-resize: resize cursor to the bottom up.
  • S-resize: resize slider top to bottom.
  • E-resize: resize cursor left to right.
  • W-resize: resize cursor right to left.
  • Ne-resize: Resize Cursor bottom-left to top right.
  • Nw-resize: Resize Cursor bottom-right to top left.
  • Se-resize: resize cursor top-left to bottom right.
  • Sw-resize: resize cursor top right to bottom left.




Note: In fact, it is easy to remember all these properties at once.
n, s, e, w correspond to the north, south, east, west, ie up, down, right, left.
Simply indicate the direction in which the cursor is pointing, followed of course "-resize".

Not accepted by all browsers


Firefox and Opera, ignore these guidelines.
  • Inherit: Even as the cursor parent tag.
  • Not-allowed: Cursor shaped round strikeout.
  • No-drop: Cursor shaped hand with fingers and a round unfolded strikeout.
  • Col-resize: Cursor is two vertical lines with an arrow on each side.
  • Row-resize: Cursor is two horizontal lines with an arrow on each side.
Best answers for « Change the appearance of the cursor in CSS » in :
MS-DOS Window - How to change the appearance? Show MS-DOS Window - How to change the appearance? Option Tab Font Tab Layout Tab Colors Tab When you open a window command prompt, it is possible to change this window (size and color). You can also change the cursor shape and other...
Personalize web pages with GreaseMonkey Show Personalize web pages with GreaseMonkey What is GreaseMonkey? Example 1 Example 2 XPath Utilities removeElement() removeAttributeOfElement() setAttributeOfElement() injectCSS() Links What is GreaseMonkey? GreaseMonkey is an...
Changing your mouse pointer ShowChanging your mouse pointer This simple tips is designated to show you how to change your mouse pointer: Right-click on your desktop and scroll to "Personalize". In the open window, select Personalize appearance and soundť....
Xubuntu – Changing Desktop appearance(Nautilus) ShowXubuntu – Changing Desktop appearance(Nautilus) When using explorer Nautilus (especially for Gnome) with Xubuntu, it is probable that when launching Nautilus, The desktop is no longer manage by XFCE, but with GNOME The command --no...
[Blogger]Changing graphical appearance of your blog Show[Blogger]Changing graphical appearance of your blog If you want to manage the visual aspect and the graphic elements of the blog, click on "Layout". By default, the blog is composed of five blocks: The navbar: located on the upper...
Download Caledos Automatic Wallpaper Changer ShowCaledos Automatic Wallpaper Changer, as its name indicates, is a screen background administrator. The main features of Caledos : - it supports the image formats BMP, GIF, JPG, TIF, - easy selection of files or folders, - the possibility of...
Declaring a style sheet (CSS) ShowDeclaring a style sheet Style sheets are not directly integrated into the W3C's HTML recommendations. For this reason, you need to include elements in the HTML code indicating both the type of document, meaning the version of the HTML and CSS...
Style classes (CSS) ShowClasses and IDs Classes A web designer might want to assign different styles to the same tags. For this reason, the CSS specifications introduced the concept of classes. The definition of classes is as simple as that of styles. It involves...
Resistance to change ShowResistance to change To be in a position to anticipate change, it is essential to understand the risk factors and in particular the causes that prevent change. Apart from individual causes, before focusing attention on a case by case basis,...