繁体   English   中英

文本在Internet Explorer中错误地换行

[英]Text wrapping incorrectly in 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).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中显示的文本位于<p>标记中,未应用任何CSS样式。

多年来,我一直在使用上面的方法来显示弹出的“帮助” div。

现在,突然之间,在Visual Studio 2010中开发一个网站-在Intranet上使用-正在使用IE 9(我们必须使用IE)进行查看(发布后)-我的帮助div中的文本不能正确包装。 文字显得有道理,单词随处中断 这与长单词不间断无关。 单词“ the”可能以一行中的“ t”和另一行中的“ he”结尾。

除了通常所说的“ blood Internet Explorer –他们做得还不错吗?”之外, -有人知道我需要做些什么才能使文本基本固定在固定宽度div中吗?

您是否尝试添加断字:正常? http://www.w3schools.com/cssref/css3_pr_word-wrap.asp

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM