A tooltip library in CSS for your lovely websites
###Try it out: http://kushagragour.in/lab/hint/
If you find this useful and want to show some love & encouragement, I am on Gittip.
Get the library using one of the following ways:
- [unminified] : https://raw.github.com/chinchang/hint.css/master/hint.css
- [minified] : https://raw.github.com/chinchang/hint.css/master/hint.min.css
Base build (Does not include color themes and fancy effects)
- [unminified] : https://raw.github.com/chinchang/hint.css/master/hint.base.css
- [minified] : https://raw.github.com/chinchang/hint.css/master/hint.base.min.css
bower install hint.css
Now include the library in the HEAD of your page:
<link rel="stylesheet" href="hint.css"></link>
<link rel="stylesheet" href="hint.min.css"></link>
Any element on your page which needs to have a tooltip has to be given at least one of the position classes:
hint--right to position the tooltip.
Hello Sir, <span class="hint--bottom">hover me.</span>
The tooltip text needs to be given using the
data-hint attribute on that element.
Hello Sir, <span class="hint--bottom" data-hint="Thank you!">hover me.</span>
[ Note: The
hint class is no more required and is deprecated. Tooltip is shown on elements which have the
data-hint attribute instead.]
Use it with other available modifiers in various combinations. Available modifiers:
Changing the prefix for class names
Don't like BEM naming (
hint--) or want to use your own prefix for the class names?
src/hint-variables.scss and change the
To generate the css file, please read the contributing page.
Who's Using This?
Are you using hint.css in your awesome project too? Let us know on the mailing list.
hint.css works on all latest browsers, though the transition effect is supported only on IE10+, Chrome 26+ and FF4+ at present.
- Chrome - basic + transition effects
- Firefox - basic + transition effects
- Opera - basic
- Safari - basic
- IE 10+ - basic + transition effects
- IE 8 & 9 - basic
hint.css is developed in SASS and the source files can be found in the
If you would like to create more types of tooltips/ fix bugs/ enhance the library etc. you are more than welcome to submit your pull requests.
See the Changelog
To catch all updates and discussion, join the mailing list: firstname.lastname@example.org.
To subscribe: email@example.com or visit here.
Copyright (c) 2013 Kushagra Gour Licensed under the MIT license.
This doesn't make use of a lot of BEM methodology but big thanks to @csswizardry, @necolas for their awesome articles on BEM and to @joshnh through whose work I came to know about it :)