Internet Explorer 11 自动换行不起作用 [英] Internet Explorer 11 word wrap is not working

查看:41
本文介绍了Internet Explorer 11 自动换行不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎文字换行不再适用于 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 没有实现任何自动换行.我曾尝试在 textarea 标签中添加wrap=hard"并添加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.

感谢您提供的任何帮助.

Thanks for any help you can provide.

这是我当前的 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

This is my computed 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çois Beauchamp.

The resolution is to apply white-space: pre-wrap to the textarea, as identified by Jean-François Beauchamp.

这篇关于Internet Explorer 11 自动换行不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆