- A+
所属分类:wordpress
alt与title效果(可显示图片)
鼠标滑过文字时alt显示图片。
代码:
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <STYLE type=text/css>BODY {
- MARGIN-TOP: 0px; FONT-SIZE: 9pt; MARGIN-LEFT: 4px; MARGIN-RIGHT: 0px; FONT-FAMILY: "宋体"
- }
- A {
- FONT-WEIGHT: 400; FONT-SIZE: 13px; COLOR: black; TEXT-DECORATION: none
- }
- A:hover {
- FONT-WEIGHT: 400; FONT-SIZE: 13px; COLOR: red; TEXT-DECORATION: underline
- }
- A:active {
- FONT: 9pt "宋体"; CURSOR: hand; COLOR: #ff0033
- }
- </style>
- <title>Untitled Document</title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- </head>
- <body>
- <script>
- function show(tips,flag,url){
- var my_tips=document.all.mytips;
- if(flag){
- my_tips.style.display="";
- if (url!=null){my_tips.innerHTML="<img src='"+url+"'align=left>"+tips;}
- else{ my_tips.innerHTML=tips;}
- my_tips.style.left=event.clientX+10;
- my_tips.style.top=event.clientY+10;
- }
- else
- {
- my_tips.style.display="none";
- }
- }
- </script>
- <a href="#" tips="自定义提示" onmousemove=show(this.tips,1) onmouseout=show(this.tips,0)>测试链接</a>
- <a href="#" tips="又一个自定义提示" onmousemove=show(this.tips,1) onmouseout=show(this.tips,0,'http://www.baidu.com/img/baidu_logo_jr_0808_aykms.gif')>测试链接</a>
- <a href="#" tips="中华人民共和国中华人民共和国自定义提示" onmouseover=show(this.tips,1,'http://www.baidu.com/img/baidu_logo_jr_0808_aykms.gif') onmouseout=show(this.tips,0,'http://www.baidu.com/img/baidu_logo_jr_0808_aykms.gif')>测试链接</a>
- <div id=mytips style="position:absolute;width:150;height:16;border:1 gray solid;font-size:9pt;background-color:#ffffff;color:red;display:none;filter: progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3);">
- </div>
- </body>
- </html>
- 我的微信
- 这是我的微信扫一扫
-
- 我的微信公众号
- 我的微信公众号扫一扫
-