Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Internet Explorer中的文本换行错误_Javascript_Css_Internet Explorer - Fatal编程技术网

Javascript Internet Explorer中的文本换行错误

Javascript Internet Explorer中的文本换行错误,javascript,css,internet-explorer,Javascript,Css,Internet Explorer,为用户提供帮助-当用户单击问号时会出现一个div: javascript函数使div出现: function showhelpby(whichdiv,e,divwidth,leftorright,message) { e=(!e)?window.event:e;//IE:Moz document.getElementById(whichdiv).style.display = 'block'; document.getElementById(whichdiv).styl

为用户提供帮助-当用户单击问号时会出现一个div:

javascript函数使div出现:

function showhelpby(whichdiv,e,divwidth,leftorright,message)
{
    e=(!e)?window.event:e;//IE:Moz

    document.getElementById(whichdiv).style.display = 'block';
    document.getElementById(whichdiv).style.width = divwidth + 'px';
    if (leftorright == 'left')
    {
        if (e.pageX)
        {
        document.getElementById(whichdiv).style.left = e.pageX - divwidth - 20 + 'px';
        document.getElementById(whichdiv).style.top = e.pageY + 'px';
        }
        else if(e.clientX)
        {
        document.getElementById(whichdiv).style.left = window.event.clientX - divwidth - 20 + 'px';
        document.getElementById(whichdiv).style.top = window.event.clientY + 'px';    
        }
    }
    else
    {
        if (e.pageX)
        {
        document.getElementById(whichdiv).style.left = e.pageX + 20 + 'px';
        document.getElementById(whichdiv).style.top = e.pageY + 'px';
        }
        else if(e.clientX)
        {
        document.getElementById(whichdiv).style.left = window.event.clientX + 20 + 'px';
        document.getElementById(whichdiv).style.top = window.event.clientY + 'px';
        }
    }
    document.getElementById('message').innerHTML = message;
}
显示的div的css为:

div.notes
{
font-family: Verdana;
font-size: 12px;
color: #000066;
line-height:140%;
display:none;
border-style:solid;
border-width:2px;
border-color:#000099;
position:absolute;
padding:15px;
background-color:#FFFFFF;
background-image:url(images/F3F3F3White200.jpg);
background-repeat:repeat-x;
overflow-y:auto;
overflow-x:hidden;
z-index:201;
}
div中显示的文本位于
标记中,没有应用css样式

多年来,我一直在使用上面的内容来显示弹出的小“帮助”div

现在,突然之间,在VisualStudio2010中开发一个网站——用于内部网——正在使用IE 9(发布后)查看(我们必须使用IE)——我的帮助div中的文本没有正确包装文本显示为对正,单词只在需要的地方断开。这与长单词不断裂无关。单词“The”可能在一行以“t”结尾,在下一行以“he”结尾


除了通常抱怨“该死的Internet Explorer-他们什么都做不好吗?”-有人知道我需要做什么才能在固定宽度的div中正确地包装文本吗?

你尝试过添加单词break:normal吗?

听起来,弹出窗口中的文本受文档css的影响。你看过Chrome或Firefox吗?发布的代码很难产生所描述的问题。请提供一份完整的文件来说明问题。(很可能你正在使用的某个工具注入了导致问题的CSS规则。)但是CSS规则会对“The”这个词说什么来打破“t”并将“he”放在下一行呢?在Firefox中看起来不错-这与IE的兼容性模式有关吗?我真的不想告诉每个用户在内联网站点的兼容模式下运行IE 9.0——只是为了正确地进行文本包装。请尝试在jsfiddle.net上重新创建该问题,以便我们可以在那里处理它。