大家都用过 img 标签 也知道里面的title 写上文字 就是鼠标移上去后的提示现在我有这样的需求 我要在提示的这段文字中 指定那几个字加粗<img src="" title="说明:abcccn\n;详细 :dkdkdkkd;"/>我要让“说明”和”详细“这些文字变粗img 

解决方案 »

  1.   

    改变不了,你可以写个事件,mouseover的时候show一个div
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
    #test{
    position:absolute;
    background-color:#CCC;
    display:none;
    font-family:Georgia, "Times New Roman", Times, serif;
    }
    </style>
    <script type="text/javascript">
    function getMousePosition(e){
    var a=e||window.event;
    var x=a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
    var y=a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
    return{
    'x':x,
    'y':y
    }
    }
    function init(){
    var images=document.images;
    var div=document.getElementById("test");
    for(var i=0;i<images.length;i++){
    images[i].onmousemove=function(e){
    var title=this.getAttribute("show");
    div.style.display="block";
    var m=getMousePosition(e);
    div.innerHTML=title;
    div.style.left=parseInt(m.x)+5+"px";
    div.style.top=parseInt(m.y)+5+"px";
    }
    images[i].onmouseout=function(){
    div.style.display="none";
    }
    }
    }
    window.onload=init;
    </script>
    </head><body>
    <div id="test"></div>
    <img src="1.gif" show="test1">
    </body>
    </html>
    这样试试
      

  3.   

    想改的话不如直接加个div来显示