Solved

Changing the cursor for an entire site.

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

705 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