Internet Explorer 11 自动换行不起作用

新手上路,请多包涵

似乎自动换行不再适用于 IE 11 中的 textarea 元素。在 IE 10 及更早版本中,FF、Safari 和 Chrome 自动换行按预期工作。

IE 11 没有实现任何自动换行。我尝试将“wrap=hard”添加到 textarea 标签,还添加了“word-wrap: normal;”到 CSS。

还有其他人遇到过这个问题吗?如果是这样,您是否找到了解决方案。 Windows 正在推出此更新,不一致的行为正在成为一个问题。

感谢您的任何帮助,您可以提供。

这是我当前的 textarea 标签

<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;

原文由 wesley 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 594
2 个回答

为了确保将来访问此问题的人的答案显而易见:OP ( wesley ) 在问题下方的评论中亲自回答了这个问题:

问题的原因是 Internet Explorer 11 使 textarea 元素继承任何 white-space 属性应用于直接父级。

决议是将 white-space: pre-wrap 应用到由 Jean-François Beauchamp 确定的文本区域。

原文由 johnkavanagh 发布,翻译遵循 CC BY-SA 3.0 许可协议

添加CSS

  {width: 100%}

这会将文本包装到它的标签中

原文由 Ylli Gashi 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题