开发者

What is the easiest way to create an HTML mouseover tool tip?

What is the easiest, c开发者_如何学编程leanest way to create an HTML mouseover tool tip without using JavaScript?

<img id=Pennstate src="/blah" style="cursor:pointer;">

mouse over that and have a a nice tooltip "We are Pennstate!"


The easiest way is to use the native HTML title attribute:

<img src="https://stackoverflow.com/favicon.ico"
     style="cursor:pointer;"
     title="Stack Overflow">

But if you need more, try the tooltip widget provided by jQuery UI since version 1.9.


If you don't care much what the tooltip looks like you can always just use the "title" attribute

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜