Solved

Changing the cursor for an entire site.

Posted on 2007-03-17
5
183 Views
Last Modified: 2011-09-20
I would like to make the mouse pointer an image for the entire site. Not just mouse over, or onhover, but for the whole page. I'm supposing it would be put somewhere in the body tag.

What do you all think?
0
Comment
Question by:healthcomputing
  • 3
5 Comments
 
LVL 5

Assisted Solution

by:PhilHow
PhilHow earned 20 total points
ID: 18741772
I stlesheet you put

* {cursor:url('yourimage.gif'}
0
 
LVL 15

Expert Comment

by:Daydreams
ID: 18746500
Hi healthcomputing,

The cursor would need to be in the form of a .cur or .ani file for IE6 and later (IE will not support other file types):

http://msdn2.microsoft.com/en-us/library/aa358795.aspx

From that page:
"Internet Explorer 6 and later. Cursor is defined by the author, using a custom Uniform Resource Identifier (URI), such as url('mycursor.cur'). Cursors of type .CUR and .ANI are the only supported cursor types."

Firefox, from version 1.5 and later, supports custom cursors:

http://developer.mozilla.org/en/docs/Using_URL_values_for_the_cursor_property

Ycan use BMP, JPG, CUR, GIF, etc. images. However, ANI is not supported. And even if you specify an animated GIF, the cursor will not be an animated cursor.

You can create custom cursors with the freeware iconArt: http://www.tucows.com/preview/293034

An example:

body {cursor: url(foo.cur), url(http://www.example.com/bar.gif), auto;}

This will first try loading foo.cur. If that file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used.

Various versions of various browsers may or may not support your custom cursor, so I would suggest not using it for anything important.
0
 
LVL 15

Accepted Solution

by:
Daydreams earned 30 total points
ID: 18746543
To be more concise, the style would be put in the head between the style tags thusly:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Custom cursors</title>
<style type="text/css">
body {cursor: url(foo.cur), url(http://www.example.com/bar.gif), auto;}
</style>
</head>
<body>
<div> Let's see if it works with your browser</div>
</body>
</html>
0
 

Author Comment

by:healthcomputing
ID: 18750354
Thanks to both of you, works like a charm.
0
 
LVL 15

Expert Comment

by:Daydreams
ID: 18750499
You're welcome healthcomputing:-)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now