Solved

Changing the cursor for an entire site.

Posted on 2007-03-17
5
189 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Text Web Page rendering differently on IE versus Chrome 3 108
Problem to picture file 3 88
React or Angular? 6 86
What does GoogleTagMgr javascripts below do 5 58
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 …
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

733 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