Internet Explorer 11自动换行不工作 [英] Internet Explorer 11 word wrap is not working
问题描述
似乎文字包装不再适用于IE 11中的textarea元素。在IE 10和更早版本中,FF,Safari和Chrome文字包装的工作原理如预期。
It seems that word wrapping no longer works for textarea elements in IE 11. In IE 10 and earlier, FF, Safari, and Chrome word wrapping works as expected.
IE 11没有实现任何字包装。我试过添加wrap = hard到textarea标签,还添加了word-wrap:normal;到CSS。
IE 11 is not implementing any word wrapping. I have tried adding "wrap=hard" to the textarea tag and also adding "word-wrap: normal;" to the CSS.
有没有人遇到这个问题?如果是这样,你找到了一个解决方案。 Windows正在推出此更新,并且不一致的行为正成为一个问题。
Has anyone else encountered this problem? If so, have you found a solution. Windows is pushing out this update and the inconsistent behavior is becoming a problem.
感谢您提供任何帮助。
这是我目前的textarea标记
Here is my current textarea tag
<textarea class="wrklst-report_text" id="report_text_6586427" name="report_text[6586427]" title="Report Box" data-exam_seq="6586427" style="width:95%;"></textarea>
这是我计算的CSS
-webkit-appearance: textarea;
-webkit-rtl-ordering: logical;
-webkit-user-select: text;
-webkit-writing-mode: horizontal-tb;
background-color: rgb(255, 255, 255);
border-bottom-color: rgb(0, 0, 0);
border-bottom-style: solid;
border-bottom-width: 1px;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(0, 0, 0);
border-left-style: solid;
border-left-width: 1px;
border-right-color: rgb(0, 0, 0);
border-right-style: solid;
border-right-width: 1px;
border-top-color: rgb(0, 0, 0);
border-top-style: solid;
border-top-width: 1px;
color: rgb(0, 0, 0);
cursor: auto;
display: inline-block;
flex-direction: column;
font-family: Verdana, Arial, sans-serif;
font-size: 16px;
height: 300px;
letter-spacing: normal;
line-height: normal;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 2px;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px;
resize: both;
text-align: start;
text-indent: 0px;
text-shadow: none;
text-transform: none;
white-space: pre-wrap;
width: 950px;
word-spacing: 0px;
word-wrap: break-word;
writing-mode: lr-tb;
推荐答案
为了确保未来访问此问题:OP( wesley )在问题下面的注释中自己回答了问题:
In order to ensure that the answer is obvious to people visiting this question in the future: the OP (wesley) answered the question himself in the comments beneath the question:
问题的原因是Internet Explorer 11使 textarea
元素继承任何 white-space
属性应用于直接父代。
The cause of the problem is that Internet Explorer 11 makes textarea
elements inherit whatever white-space
property is applied to the direct parent.
解决方法是应用 white- space:pre-wrap
指向textarea,由 Jean-FrançoisBeauchamp 标识。
The resolution is to apply white-space: pre-wrap
to the textarea, as identified by Jean-François Beauchamp.
这篇关于Internet Explorer 11自动换行不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!