[advanced search]
Results from the most recent live auction are here.
17 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming > CODE
User Name
Password

Old 05-16-2006, 09:21 AM   · #1
tm
Senior Member
 
tm's Avatar
 
Name: TheMoose
Location: on a oil rig just off Ireland
Trader Rating: (24)
Join Date: Nov 2005
Posts: 1,402
NP$: 434.65 (Donate)
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
[CSS] Custom cursors

It's surprisingly easy to do custom cursors in CSS.

It's all controlled under the property cursor:
pointer is a hand (like hovering on a link) - useful for javascript OnClick links when the hand never happens.
default is just the original old cursor.
crosshair is a + symbol. Not very attractive.

Others include:
move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress
Which are pretty self-explanitory. (North East, north west, etc for the resize icons).

So how do you do a custom cursor?

put in your div/class/whatever:
Code:
cursor: url(url/to/custom/cursor.ico), url(../url/to/custom/cursor), default;


let me go through this step by step.
Code:
url(url/to/custom/cursor.ico)

This bring up the custom cursor file from the URL specified.
Code:
url(../url/to/custom/cursor.ico)

is a hack for other browsers.

Code:
default;
justs makes the cursor default for unsupported browsers.

So how to make a .ico file?

Simple really. Make a 16x16 (max) file, decorate it or whatever and then save it as .gif (.ico if available). Then rename the .gif to .ico. Then call it in the css file.

Enjoy!


Please register or log-in into NamePros to hide ads
__________________
You design in photoshop, I code into valid XHTML/CSS.
Professional PSD, PNG or HTML to tableless XHTML/CSS designs.
For more info, send me a PM.
tm is offline   Reply With Quote
Old 05-16-2006, 11:48 AM   · #2
wvccboy
Account Closed
 
Name: Jay
Trader Rating: (16)
Join Date: Jan 2006
Posts: 460
NP$: 71.00 (Donate)
wvccboy is a jewel in the roughwvccboy is a jewel in the roughwvccboy is a jewel in the rough
nice tip! Rep added
wvccboy is offline   Reply With Quote
Old 05-28-2006, 02:34 AM   · #3
tm
Senior Member
 
tm's Avatar
 
Name: TheMoose
Location: on a oil rig just off Ireland
Trader Rating: (24)
Join Date: Nov 2005
Posts: 1,402
NP$: 434.65 (Donate)
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
No problem
__________________
You design in photoshop, I code into valid XHTML/CSS.
Professional PSD, PNG or HTML to tableless XHTML/CSS designs.
For more info, send me a PM.
tm is offline   Reply With Quote
Old 06-03-2006, 12:40 PM   · #4
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
On 6YD I had a cursor problem. I wanted to have an "onClick" in a div but without using a link. To make it look like a link I used this code:
Code:
style="cursor: hand;cursor: pointer;"


That will bring up the default link cursor. There are also a load of other default cursors (I don't know off the top of my head) but you can use them like that!

Hope this adds to your informative thread nicely! Thanks for the info though, it could come in useful at some point. I remember trying in vain to find out how to do that!
PoorDoggie is offline   Reply With Quote
Old 06-04-2006, 01:56 AM   · #5
tm
Senior Member
 
tm's Avatar
 
Name: TheMoose
Location: on a oil rig just off Ireland
Trader Rating: (24)
Join Date: Nov 2005
Posts: 1,402
NP$: 434.65 (Donate)
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
Yep,

Here is the list:

Default | pointer | Crosshair | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress

Thanks for your extra info
__________________
You design in photoshop, I code into valid XHTML/CSS.
Professional PSD, PNG or HTML to tableless XHTML/CSS designs.
For more info, send me a PM.
tm is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


Site Sponsors
http://www.mobisitetrader.com/ Build your NameBrand http://www.dnfinder.com
Advertise your business at NamePros
All times are GMT -7. The time now is 01:20 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0