Tweak Mouse Pointers using CSS

I updated the Multiply Site of my ex-high school computer organization when I realized that it would be better if the mouse pointer will be changed. Oh! The Cascading Style Sheet (CSS) is the best technique to change this. It has a rule that directly modifies the mouse pointer that a user sees.

How to add a CSS declaration in your HTML File
Adding a custom CSS in a web page could be done in different ways. But embedding such is the easier one (though not always recommended). Here is an example of an embedded CSS in a webpage:

<style type = “text/css>
rules…
</style>

Notice that by using the <STYLE> container tag, you can add a custom CSS. Inside the said tag are the rules needed for the page.

Now, here are some of the rules in modifying the page’s mouse pointer (hover on each rule inside a box to see the actual pointer):

{
cursor: auto;
}

{
cursor: crosshair;
}

{
cursor: default;
}

{
cursor: pointer;
}

{
cursor: move;
}

{
cursor: e-resize;
}

{
cursor: ne-resize;
}

{
cursor: nw-resize;
}

{
cursor: n-resize;
}

{
cursor: se-resize;
}

{
cursor: sw-resize;
}

{
cursor: s-resize;
}

{
cursor: w-resize;
}

{
cursor: text;
}

{
cursor: wait;
}

{
cursor: help;
}

By the way, you can embed the tag inside the or tags. Though most developers are using the former. These sample rules are taken from ShewShack site.

8 Comments

  1. my page is a school web page so you probably won’t be able to access it but I was wondering how to change my mouse from an arrow to a jpg image

  2. Hello Michael,

    You can change your web page’s default mouse pointer using the same scheme that I have explained in my entry – CSS. I am not sure if it is possible to use a JPEG file format as the image of your pointer. I think the cursor file with file extension “.CUR” or the animated cursors with file extension “.ANI” are the ones being supported. You can use this site to download tons of cursor and animated cursor files:

    http://www.rw-designer.com/cursor-library

    Now, your mouse pointer could change either on the whole page or on a specific part of your page. Here are the codes:

    FOR WHOLE PAGE:
    (This should be placed inside the tags)

    body, html { cursor: url(‘arrow.cur’); }

    :: where “arrow.cur” is the name of your cursor file

    FOR A SPECIFIC PART:
    (Cursor changes in a specific paragraph)

    :: Just add the STYLE attribute with a value of the cursor rule.

    Hope this helps. Thanks for visiting my blog.

    Ciao!

    ARMAN

  3. My apologies for the previous comment. WordPress eliminates the tags I have included there. I will be sending the same message in your email.

    Thanks :D

  4. hey arman! kamusta na? :D

    i hope you’ll post more entries about CSS codes. it’ll be really helpful since i’m trying to learn about CSS and stuff nowadays. hehe!

  5. I would like to see a continuation of the topic

  6. very interesting.
    i’m adding in RSS Reader

  7. CSS is a great .. it’s easy to learn…

    http://www.jayrsiaboc.cjb.net

  8. hey, can u help me putting crosshairs on my friendster. yung crosshair na malaki talaga, from top to bottom and left to right.

    thanks in advance.

    by the way im not a programmer.
    ehehe


Comments RSS TrackBack Identifier URI

Leave a comment