?
Solved

Changing the cursor for an entire site.

Posted on 2007-03-17
5
Medium Priority
?
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 5

Assisted Solution

by:PhilHow
PhilHow earned 80 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 120 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

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

765 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