12

How to Customize Your Mouse Cursor with CSS

Use Cascading Style Sheets to Create Custom Cursors

The Armchair Geek
Cascading Style Sheets, or CSS, is a style sheet language used in web development to describe the presentation of structured documents. CSS is used to design and customizing web pages written in HTML by defining colors, font, and layout of text.

Aside from designing web sites, CSS can be used to customize features of your web pages, and create numerous effects. You can, for example, totally revamp the design and appearance of your cursor. You simply have to insert particular CSS code into your HTML field. If the code is properly inserted, the cursor will be modified based on the conditions defined in the code.

This tutorial will present examples of the different types or styles of cursors, along with code an instructions on how to customize your own cursor.

Here are examples of the codes for creating a number of different cursor effects:

Default
cursor:default

Crosshair
cursor:crosshair

Hand
cursor:hand

Pointer
cursor:pointer

Move
cursor:move

Text
cursor:text

Help
cursor:help

Wait
cursor:wait

Resize north
cursor:n-resize

Resize northeast
cursor:ne-resize

Resize east
cursor:e-resize

Resize southeast
cursor:se-resize

Resize south
cursor:s-resize

Resize southwest
cursor:sw-resize

Resize west
cursor:w-resize

Resize northwest
cursor:nw-resize

Not allowed
cursor:not allowed

All-scroll
cursor:all-scroll

Using CSS to define your cursor style
Image #1:
*In order to change cursor style when it hovers over links, use the following code:
Replace value with the desired cursor effect.

Image #2:
*In order to change cursor style for the entire page, use the following code:
Replace value with the desired effect.

Image #3:
*In order to change the cursor style for certain areas of the page, use the following code:
Replace value with the desired effect.

The mentioned examples provide the fundamentals of Cascade Style Sheets. Creating cursors is just one capability of CSS.

In addition to this, Cascading Style Sheets allows users to store information that is used to define font, color, and layouts into one file, instead of having to create an HTML code for every instance it is needed. You can control the format of many documents with a single style sheet. This saves a whole bunch of time because you don't have to reenter a code every time you need a certain text effect. CSS also provides a more precise means of controlling layout.

CSS can also be used to apply different layouts to different media types. CSS provides a more sophisticated and advanced means of manipulating web layouts than HTML. Microsoft Internet Explorer 4+ and Netscape Navigator 6+ both support CSS coding.

Published by The Armchair Geek

We are a Mid-West PLR Firm specializing in creating powerful web content for clients in a wide array of industries. This is a sampling of some of our IT-focused articles. For more of our work, you can co...  View profile

CSS can be used to customize features of your web pages, and create numerous effects, e.g. totally revamping the design and appearance of your cursor. This tutorial will walk you through customizing your mouse cursor using CSS

2 Comments

Post a Comment
  • sezer6/20/2008

    css Cursor examples , Properties , Attribute - - http://css-lessons.ucoz.com/cursor-css-examples.htm

  • cemil6/18/2008

    css Cursor examples , Properties , Attribute - - http://css-lessons.ucoz.com/cursor-css-examples.htm

Displaying Comments

To comment, please sign in to your Yahoo! account, or sign up for a new account.