BlacKnight's Website > Coding > CSS > Custom cursor ( Curseur personnalisé )
Coding
BKcore.com

Everything about programming and development,
Snippets, tutorials, tips or discoveries,
In programming languages like PHP, Flash, HTLM, CSS, Javascript or even C++.
Want to add you're own codes ? Then send me an email.


Today we'll see how to customize a web page cursor using CSS. Wink


Requested :
  • A cursor : .cur or image ( png or gif is better because they use transparency )
  • A html page with a custom css part Gaa :
<style type='text/css'>
    CSS goes here
</style>


Code :
body
{
    cursor: url("path/to/image.png");
}


The 'cursor' property can also get a string value corresponding to a specific OS cursor.
Here is the complete list of available cursors :
  • auto
  • crosshair
  • default
  • pointer
  • move
  • e-resize
  • ne-resize
  • nw-resize
  • n-resize
  • se-resize
  • sw-resize
  • s-resize
  • w-resize
  • text
  • wait
  • help
  • progress
  • inherit

Example :
The box bellow uses a custom cursor :

Class of the box :
.ex_CustomCursor
{
    cursor : url("cursor.png"), url("cursor.cur"), pointer;
}


As you can see, it's possible to define more than one cursor. In that case, if the first one can't be loaded, then the second one will be loaded, and so on.

Hope you liked this little tip,
See you for the next one Wink
Comments
xdtvaagonld
08/05/08

kHqizV <a href="http://enylwmbfbmqe.com/">enylwmbfbmqe</a>, [url=http://wnxmqkxttfjc.com/]wnxmqkxttfjc[/url], [link=http://pqkyevchpdrp.com/]pqkyevchpdrp[/link], http://sjsthkoblqto.com/

BlacKnight
09/03/08

Well, first, i'd suggest beginning with a user-friendly yet powerful linux distribution like Ubuntu ( see http://ubuntu.com/ )
Their community is well furnished, and there are a lot of tutorials on the forum.

PS: Next time, try to post on an article that talks about linux, or contact me by mail ;)

Steve
07/03/08

What texts would best describe how to write your own linux coding? I am sick of windows and would like to get my linux up and running, however I am not on the net much, so I don't know where to go..... please help... hahah

BlackTalon
01/12/07

Good One :)

BlacKnight
29/10/07

Thanks ;)

JaMeS
27/10/07

Nice :)

 
Comment
 





 
©BlacKnight ◊ BKcreation ◊ 2007 ◊ Administration
flag_en.gifflag_fr.gif
Home About Journal Creations Coding Projects Links Contact