Due to some circumstances, this blog is now up for sale, for more enquires contact: Plushista@gmail.com
RealcomBiz
Pin It

CSS Cursors: An Ultimate Guide

by Unknown | Monday, September 22, 2014 | 77 Comments

The typical browser will display the mouse pointer over any blank part of a web page, the gloved hand over any item that is linked (click-able) and the edit cursor over any text or text field. With CSS you can redefine those properties to display a variety of different cursors.



You have to be mindful of how you manipulate your cursor. CSS cursors (built-in or custom) should be used as a hint to the user as to know what action the mouse can perform. Let’s take a look at an example that doesn’t use custom cursors to illustrate a common use-case: drag and drop. To give users a visual clue that an item is draggable, a CSS cursor property with move as value should be set. Or a case of a resizeable box, these has to be indicated. Below is a code snippet that change mouse cursor icon to move.

.class {
cursor: move;
}

The built in cursor are nice but you have to know that they may look different depending on users browser/operating system. For example, some browsers (e.g. Firefox on Windows 7) will show the move cursor as a four-pointed arrow () while others (e.g. Firefox on Mac OS X) will show a hand ().
It might be important for you to see exactly how each built-in cursor will appear across browsers and platforms. The images below demonstrate how each cursor appears (thanks to tutsplus for the image):


Windows 7
  • IE9
  • IE8
  • Chrome
  • Safari 5.1.7
  • Firefox
  • Opera



Windows XP
  • IE9
  • IE8
  • Chrome
  • Safari 5.1.7
  • Firefox
  • Opera



OSX 10.8
  • Chrome 22.0
  • Safari 6.0
  • Firefox 15.0
  • Opera 12.02



You might need a live demo. The table below demonstrates few cursors most browsers will accept. Hover your mouse pointer over each box under the "Live example" column to reveal that cursor.



Icon Value Live example (move mouse over box)
auto The User Agent determines the cursor to display based on the current context.
inherit Takes on its parent element's computed cursor value.
default
style="cursor: default;"
hand
style="cursor: hand;"
pointer
style="cursor: pointer;"
hand & pointer
style="cursor: pointer; cursor: hand;"
crosshair
style="cursor: crosshair;"
text
style="cursor: text;"
wait
style="cursor: wait;"
help
style="cursor: help;"
move
style="cursor: move;"
progress
style="cursor: progress;"
all-scroll
style="cursor: all-scroll;"
col-resize
style="cursor: col-resize;"
no-drop
style="cursor: no-drop;"
not-allowed
style="cursor: not-allowed;"
row-resize
style="cursor: row-resize;"



Implementing Custom Cursor

You might not find a built-in cursor that is suitable for your project. A good example is a paint bucket or a magnifying glass + or - over zoomable image - none of those cursors exist natively in any browser, and not all browsers support all the same "built-in" cursors. Using custom cursors, you can implement all of these in all browsers.

The cursor CSS property accepts a series of cursors, and using a url() value you can set a custom CSS cursor:

.class  {
cursor:  pointer;
cursor:  url(custom.cur) 2 4, pointer;
}

In the above example custom.cur is the custom cursor file, uploaded to your server space, and pointer is the generic cursor that will be used if the custom cursor is missing, or isn't supported by the viewer's browser.

You can also specify the coordinates of the cursor's hotspot, which will be clamped to the boundaries of the cursor image. The first number is the x-coordinate, and the second number is the y-coordinate. The example will set the hotspot to be the pixel at (2,4) from the top left (0,0).

If you add the CSS code into an external .css file, take note that modern browsers (Mozilla Firefox, Google Chrome) will interpret the custom cursor's URL as relative to the location of the stylesheet (as per the W3C's recommendation). However, Internet Explorer (7-9) will interpret the URL relative to the HTML root. So, in the code in .css add two url paths for .cur file, one relative to the .css file, and other url relative to the HTML document in which the .css file is included.
For example, if the .cur and .css files are in the same folder, named styles, and the HTML document is in a directory above this CSS file, we'll use this code in the .css file:

.class {
cursor: url('custom.cur'),  /* Modern browsers */
          url('styles/custom.cur'),  /* Internet Explorer */
          pointer;  /* Built-in fallback */
}


Other things to note

  • The standard format that can be used for cursors is the .cur format. However, you can convert images such as .jpg and .gif into .cur format using the online image converter software.
  • Internet Explorer up to and including version 9 only support URL values of type .cur for static cursor, and .ani for animated cursor. However browsers such as Firefox, Chrome and Safari have support for .cur, .png, .gif and .jpg but not .ani.
  • A good practice it to make sure your .cur files are 32×32 pixels in size. IE9 seems to re-size cursors that are smaller than this to 32×32, and IE8 and under cannot show cursors larger than this size. While it is true that you can fit multiple file sizes inside a .cur file, sticking with one 32×32 image will ensure cross-browser consistency.

See the table below for browser compatibility checkup:


Browser Lowest version Formats x-y-coordinates
Internet Explorer 6.0 .cur | .ani ---
Firefox (Gecko), Windows and Linux 1.5 (1.8) .cur | .png | .gif | .jpg 1.5 (1.8)
Firefox (Gecko) 4.0 (2.0) .cur | .png | .gif | .jpg | .svg (Gecko 2.0)
Opera --- --- ---
Safari (Webkit) 3.0 (522-523) .cur | .png | .gif | .jpg 3.0 (522-523)
Since OS X 10.5 supports Safari (Mac) .cur files


Now don't go doing this willy nilly, use a custom cursor in places where you think important. Also, keep in mind that users are used to the built-in ones, so your custom cursor shouldn’t look too much different than them if you want your interface to be easy-to-use.



Go Social:

Subscribe For Free Updates!

*Please confirm the email sent to your inbox after clicking "Sign Up!".

77 comments : Post Yours! Read Comment Policy ▼
PLEASE NOTE:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.

  1. The post is written in very a good manner and it entails many useful information for me.
    Online journalism programs

    ReplyDelete
  2. Thanks For Share This Nice details..
    t20 wc 2016 live streaming How We Celebrate vents With your Best friends.

    ReplyDelete
  3. Marvelous writing practice! The tactics which are presented here is in a balanced portion of reading. Thanks much

    Batman jacket at Desertleather

    ReplyDelete
  4. Newbies Guide To Blogging For Success Blogging and Promoting Your Online Business Is Easy! term paper writers awesome writer

    ReplyDelete
  5. football live streaming
    Watch live football on TV today at livefootballontv1.com. Checkout what time your favorite football is live on tv.

    ReplyDelete
  6. good Mobdro Free of charge App on Apple computer systems applying BlueStacks. Mobdro Website Mobdro APK record is merely compatible with Android os type 4.1 or bigger equipment. Mobdro Site Official great.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. good you will will need to apply an Android os emulator. Bluestackstutorial With Andy, you rarely include to be anxious about safe-keeping as official website nice.

    ReplyDelete
  9. good obligatory for employing the very best beautiful fast WeChat on Computer. nice guide Today comply with the below mentioned measures. official website nice.

    ReplyDelete
  10. Optimistic article! I have catch up important information here and preserve and preserve a valuable experience.
    captain america jacket

    ReplyDelete
  11. Sounds simple to read! The focus on the topic is full time and really awesome at the concept. Thanks for sharing here.
    Awkward moment cosplay costume

    ReplyDelete
  12. Optimistic article! I have catch up important information here and preserve and preserve a valuable experience.
    click here

    ReplyDelete
  13. good After that, you will be redirected to the Google Play Store. thanks to clashroyaleforpci as with just eight cards to work with, Clash Royale nice.

    ReplyDelete
  14. good After receiving the data file, it should get utilized in buy to get started on assembly. this page which you will surely use some sizeable volume of period CinemaBox Download Free nice.

    ReplyDelete
  15. The cursor property in CSS controls what the mouse cursor will look like when it is located over the element in which this property is set. I read this in an article.
    Dissertation writing service usa

    ReplyDelete
  16. Ganesh Chaturthi 2016 SMS
    Diwali 2016 SMS
    top 10
    498a
    Dog boarding in bangalore
    happy new year 2017 SMS Images
    Dussehra 2016


    http://top10reviewz.in/jamshedpur-must-visit-places/
    http://menvictims498a.in/anticipatory-bail-498a/
    http://swearondog.in/#service
    http://www.happydiwali2015smshd.in/2015/09/happy-diwali-2015-hd-lakshmi-ganesha.html
    http://www.ganeshchaturthi2015sms.in/2015/08/happy-ganesh-chaturthi-2015-latest.html
    http://www.happydussehra2015smshd.in/2015/08/we-are-in-month-of-festival-october-and.html
    http://www.happynewyear2016smshd.in/2015/08/happy-new-year-2016-latest-hindi-sms.html

    ReplyDelete
  17. Hay, i just got best collection of happy diwali 2016 wish and images
    http://www.2016diwaliwishes.com/2016/09/best-collections-of-2016-happy-diwali.html?m=1

    ReplyDelete
  18. Nice blog.
    Get exclusive ideas for wishing happy diwali 2016 greetings to your family.

    ReplyDelete
  19. Nice blog.. Get latest Happy Diwali Greetings Wishes, Messages and quotes to your family members..

    ReplyDelete
  20. good and capable function photography lovers and will carry out bigphotographers to boost your skill is normally to reading word catalogs nice.

    ReplyDelete
  21. iOS 10 is the tenth major release of the iOS operating system developed by Apple Inc., being the successor to iOS 9.iOS 10 improves and adds upon user experience system-wide including 3D Touch expansion, an updated lock screen, and "widget" support.
    To download Latest IOS version "IOS 10" and its Jailbreak free from CydiaNerd.

    ReplyDelete
  22. Vashikaran mantra for wife to control her mind Marriage is the entrance of two human beings in the new phase of life after their marriage.Vashikaran is a very powerful way to control on someone mind

    ReplyDelete
  23. Great With iTunes, you likewise have got to attribute to encode your preferred music itunes store From considering that after that, it has actually won enormous appeal as well as in 2010 Fine.

    ReplyDelete
  24. good IMO for PC is the most recent emerging video calling and talking app, imo No need to do SMS anymore, make use of IMO for PC to do messaging nice.

    ReplyDelete
  25. Great This Vidmate app PC Variation is not launched vidmatedownloadz technology of this Vidmate PC application Fine.

    ReplyDelete
  26. good any TELEVISION programs worldwide with streaming. Mobdro App or to download any other free android apps. best.

    ReplyDelete
  27. good ShowBox: New Show box is the film app readily available for https://mobdro.uk premium. We can likewise make use of the cost-free variation great.

    ReplyDelete
  28. Residential property in Noida top 10 residential property in Noida. One of the largest city of Uttar Pradesh. Buy/Rent/Sell residential property in Noida.

    ReplyDelete
  29. good Without squandering any kind of further time Aptoide for iOS it to you in this post, just how you can utilize it better.

    ReplyDelete
  30. thanks for the nice article great work keep it up
    You Can also read:
    Holi Images

    ReplyDelete
  31. good Fusion Installer on a tidy installation of Kodi, just follow install fusion kodi Fusion Addon Installer is a program addon that permits nice.

    ReplyDelete
  32. good giving our recommendations for the very best interior and also exterior table. https://pingpongtablee.com area or products that are much more resilient against the components nice.

    ReplyDelete
  33. Thx for writing so good stuff , hope this information is good for all. please post same topic in future for out motivation

    How to get back suspended you tube channel

    ReplyDelete
  34. nice article,its very nice and useful content have a glance on my blog fastpokemap apk

    ReplyDelete
  35. good the application that you intend to mount on You TV Player This application is more than the simply video clip player. best.

    ReplyDelete
  36. one point that this Pokemon Go APK's most current Tutuapp APK A similar app like TuTuApp is Freedom App. Do check.

    ReplyDelete
  37. Along with the features available in each video player, you tv player app any kind of TV shows from around the world.

    ReplyDelete
  38. Quick Shortcut Maker APK from this short article below. quickshortcutmaker download you need to adhere to in order to obtain via.

    ReplyDelete
  39. you to surf the internet the method you desire. opera browser download initially you need to set up the software called bluestacks.

    ReplyDelete
  40. Your article is overpowering. I like it and your work is battering. I genuinely happy to get it and I wish to check out extra on this site. A responsibility of appreciation is with the target for proposing to us pink leather jacket

    ReplyDelete
  41. Hey friend, it is very well written article, thank you for the valuable and useful information you provide in this post. Keep up the good work! FYI,
    How to remove credit card from apple id, Good Vibes Good Life Book Pdf Download Free, 10 lines on Doctor in English, what age do huskies stop growing

    ReplyDelete
  42. Hello. Extremely decent site!! Man .. Incredible .. Superb .. I'll bookmark this site and take the feeds likewise… I am glad to find such a lot of supportive data here inside the article. A debt of gratitude is in order for sharing…Chrome Heart Hoodies

    ReplyDelete

Recent Posts

Let's Connect

Site Links

Copyright © 2014 RealcomBiz. All Rights Reserved.
Powered by Blogger