jQuery 1.9.1 を使用して、Web ページの CSS に次のコードを追加します。
.breakword {
-ms-word-break: break-all;
word-break: break-all;
// Non standard for webkit
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
font-size: 0.9em; font-weight: normal;
}
HTML コードには次のものがあります。
<td class="breakword" align="left" style="width:54%;vertical-align:middle;">
<select name="vlist" id="vlist" class="choices">
</select>
</td>
上記select
には、SQL クエリの結果が入力されています。
テーブルから取得された項目の 1 つが入力フィールドよりも長い場合があります。Firefox では、複数行で正常に表示されます。ただし、IE8では、1行以外は表示できません。また、隣のフィールドをオーバーレイします。
取得されるデータは次のとおりです。
<Row>
<ID>15</ID>
<vtext>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</vtext>
</Row>
<Row>
<ID>16</ID>
<vtext>This is a test item for the dropdown</vtext>
</Row>
これをIE8で正しく機能させるために何が欠けていますか?