2013-11-22 44 views
32

似乎自動換行不再適用於在IE 11 textarea元素在IE 10和更早的版本,FF,Safari瀏覽器和Chrome自動換行按預期工作。的Internet Explorer 11自動換行不工作

IE 11未執行任何文字換行。我曾嘗試在textarea標記中添加「wrap = hard」,並添加「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; 
+0

沒有攝製。你沒有表現出什麼,或者你錯了。 – Will

+0

您需要指定重現問題的實際輸入數據,解釋您希望發生的情況以及發生的情況。 「不工作」不是問題描述。 –

+6

我發現了這個問題。非常感謝您的意見。它幫助了很多。看來,IE 11現在使textarea元素繼承了其父div的「空白」屬性。 – wesley

回答

59

爲了確保答案是顯而易見的,以羣衆來訪,未來這一問題:OP( wesley)回答了這個問題自己在問題之下的評論:

問題的原因是Internet Explorer 11讓textarea元素繼承任何white-space屬性應用於直接父級。

分辨率是應用white-space: pre-wrap到textarea的,所確定Jean-François Beauchamp

+0

textarea white-space:pre-wrap; } 在CSS解決了我的問題,謝謝! – breez

+1

在Maximo中,存在相同的問題。在textarea之前的樣式標籤中,我不得不添加空格:預先包裝,以便文本區域正確包裝。 - 例如'overflow:white-space:pre-wrap;「maxlength =」32000「' - 在Chrome 43和Firefox 38中沒有這個問題。 – Sun

0

請注意,IE11在兼容模式下不會正確換行。要了解它,請單擊Alt,工具,Internet選項,安全,本地Intranet,站點,高級。看看列表中有什麼。

4

添加CSS

{width: 100%} 

這將文本換到它的標籤

2

我來到這裏的,其中自動換不上IE11工作不同的問題;

{width: 100%}解決方案確實爲我工作。

2

我也有類似的問題,通過改變自動換造型字斷造型解決了這個問題:

{ word-break: break-all; } 
+0

我看你使用Internet Explorer,3年多後回答。 – iCarnagy

相關問題