1.用<SPAN Title=“要提示的内容”>
2.用<a>结合鼠标的OnMourseMove和OnMouserOut事件在状态栏中显示
实列代码如下:
- <!HTML4.0规范,不可少哦>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
- <html>
- <head>
- <title>鼠标显示提示文字</title>
- <!STYLE元素定义顶级元素BODY与行内元素SPAN的样式>
- <style>
- span{background-color:yellow;}
- body{cursor:default;}
- </style>
- </head>
- <body>
- <p>
- <span title="Christmas--n.圣诞节">Christmas</span> is an important <span title="festival--adj.节日(的),喜庆(的)">festival</span> in <span title="Britain--n.大不列颠">Britain</span> and many other parts of the world!
- </P>
- <p>
- <!用超链元素A.../A将要设置提示信息的单词分别设成超链形式>
- <!HREF元素的值设置为"javascript:void(null)"表示该链接为空链接,不链接到其他地方>
- <!onMouseMove事件设置鼠标移动到该链接时的提示信息,而不是onMouseOver>
- <!onMouseOut事件设置鼠标离开该链接时的提示信息为空白,即将提示信息清除>
- <!window.status="某个字符串"表示在状态行设置提示信息>
- <a href="javascript:void(null)" onMouseMove="window.status='Christmas--n 圣诞节'" onMouseOut="window.status=''">Christmas</a> is an important festival in Britain and many other parts of the world!
- </p>
- </body>
- </html>