title标签换行、加图片等显示控制例子

1、加了JS控制TITLE显示效果(比较麻烦)
     <html>
     <head>
     <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
     <title>自定义title - 51windows.net</title>
     </head>
     <body>
     <center>
     <span title="欣赏美不应该是一种痛苦</br>Love You</br>Forever">爱我的人已经远去,只有自己照顾自己</span><br><br>
     <span title="<marquee style='width:100px;'>www.51windows.net</marquee>" altbg="red" altcolor="yellow" altborder="yellow">滚动
    
     字幕</span><br><br>
     <span title="<img src='http://www.51windows.net/51windows.net.logo.gif' border='0'>" altbg="#F7F7F7" altcolor="#999999"
    
     altborder="#CCCCCC">图片</span><br><br>
     <span title="<i style='font-size:24pt;font-family:verdana;'>www.51windows.net</i>" altbg="green" altcolor="yellow"
    
     altborder="darkgreen">大字体</span><br><br>
     <div style="display:none;border:1px solid #000000;background-color:#FFFFCC;font-size:12px;position:absolute;padding:2;"
    
     id=altlayer></div>
     <SCRIPT LANGUAGE="JavaScript">
     <!--
     document.body.οnmοusemοve=quickalt;
     document.body.οnmοuseοver=getalt;
     document.body.οnmοuseοut=restorealt;
     var tempalt='';
    
     function getalt(){
     if(event.srcElement.title && (event.srcElement.title!='' || (event.srcElement.title=='' && tempalt!=''))){
     altlayer.style.left=event.x;
     altlayer.style.top=event.y+20;
     altlayer.style.display='';
     tempalt=event.srcElement.title;
     tempbg=event.srcElement.altbg;
     tempcolor=event.srcElement.altcolor;
     tempborder=event.srcElement.altborder;
     event.srcElement.title='';
     altlayer.innerHTML=tempalt;
     if (typeof(tempbg)!="undefined"){altlayer.style.background=tempbg}else
    
     {altlayer.style.background="infobackground"}
     if (typeof(tempcolor)!="undefined"){altlayer.style.color=tempcolor}else
    
     {altlayer.style.color=tempcolor="infotext"}
     if (typeof(tempborder)!="undefined"){altlayer.style.border='1px solid '+tempborder;}else
    
     {altlayer.style.border='1px solid #000000';}
     }
     }
     function quickalt(){
     if(altlayer.style.display==''){
     altlayer.style.left=event.x;
     altlayer.style.top=event.y+10;
     }
     }
     function restorealt(){
     event.srcElement.title=tempalt;
     tempalt='';
     altlayer.style.display='none';
     }
     //-->
     </SCRIPT>
     2、控制回车还可以用,& # 10,& # 13硬回车和软回车。

转载于:https://my.oschina.net/ind/blog/222064

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值