CDの保有枚数を教えてください

↓にて質問させていただいたのですがうまくいかなかったのでもう一度質問させてください。
http://okwave.jp/qa/q8552159.html

上記で教えていただいたことをもとに禁則処理により不自然な折り返しを解除しようとしたのですが
うまくいきませんでした。「line-break」というのも付けてみましたが結果は同じで不自然な位置で
折り返しが発生しています。試した環境はIE11になります。
下記がそのHTMLになります。


<html>
<head>
<style type="text/css">
td {
word-break: break-all;
word-wrap: break-word;
line-break: normal;
}
</style>
</head>
<body>
<textarea name="MSG" cols=40 rows=4 style="word-break: break-all;word-wrap: break-word;line-break: normal;">テスト中です。サンプルテキスト!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</textarea>

<table border="1">
<tr>
<td width="400" style="word-break: break-all;word-wrap: break-word;line-break: normal;">
テスト中です。サンプルテキスト!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</td>
</tr>
</table>
</body>
</html>

A 回答 (2件)

あー、うまく行きませんでしたか。


Chromeでは確認したのですが、IEでは確認していませんでした。すみません。


もうご存知と思いますが、禁則処理は英文字の長い単語が単語の途中で改行されないように改行位置を調整する処理です。また、それに加えて、文末の記号も同様の扱いで「.」「!」などがついていればそれも単語を構成する文字とみなされるはずだと思います。

実際にChromeではそのような動きで、文末の記号の連続でも一つの単語と同じように禁則処理・その解除が行われていました。

しかしIEでは文末の記号は別扱いで、文末記号は何があっても絶対に行頭に持ってこさせない処理を行っているようです。私にはChromeの動きが正しくIEの動きがバグのような気もします。そもそも行末記号が連続することが例外とも言えますので、考慮漏れをしているのかもしれません。しかし、もしかしたらMS社として正しいと思ってそのような仕様にしているのかもしれません。


結論として
少なくとも現行バージョンのIEでは、行末記号の連続の禁則処理の制御の解除はできません。
これを回避する正当な手段は現状では存在しないと思います。

対応としては
・行末記号の連続をやめる
・行末記号の連続中で、何文字かおきに半角スペースをいれる
・「!」の連続では画像を使う(これが一番いいかも)
・IEはあきらめる

位しかないと思います。苦肉の策ですが…
    • good
    • 0
この回答へのお礼

ご回答ありがとうございます。
私もChrome、FireFoxで試してみましたがIEはやはり
ダメでした。何とも恨めしく思っています。
IEはあきらめようと思います。どうもありがとうございました。

お礼日時:2014/04/14 23:37

単純に!!


word-break:keep-all;でよいはずですが???
 ⇒5.3. Breaking Rules for Letters: the ‘word-break’ property( http://www.w3.org/TR/css3-text/#word-break-prope … )
【サンプル】
★タブは_に置換してあるので戻す。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
_<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
_<title>サンプル</title>
_<meta name="author" content="ORUKA1951">
_<meta http-equiv="Content-Style-Type" content="text/css">
_<link rev="made" href="mailto:oruka1951@hoge.com" title="send a mail" >
_<link rel="START" href="../index.html">
_<style type="text/css">
<!--
html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6{margin:0;line-height:1.6em;}
p{text-indent:1em;}
div.header,div.section,div.footer{width:90%;min-width:630px;max-width:900px;margin:0 auto;padding:5px;}
table,td{width:16em;}
div.word-wrap-normal td,div.word-wrap-normal text-area{word-wrap:normal;}
div.word-wrap-break-word td,div.word-wrap-break-word{word-wrap:break-word;}
div.word-break-normal td,div.word-break-normal{word-break:normal;}
div.word-break-keep-all td,div.word-break-keep-all{word-break:keep-all;}
div.word-break-break-all td,div.word-break-break-all{word-break:break-all;}
-->
_</style>
</head>
<body>
_<div class="header">
__<h1>タイトル</h1>
__<p>折り返しパターンのテスト</p>
_</div>
_<div class="section">
__<h2>word-wrap</h2>
__<p>折り返しパターンテスト</p>
__<blockquote cite="http://www.w3.org/TR/css3-text/#word-break-prope …
___<dl>
____<dt>normal</dt>
____<dd>Words break according to their usual rules.
____<dt>break-all>/dt>
____<dd>In addition to ‘normal’ soft wrap opportunities, lines may break between any two letters (except where forbidden by the ‘line-break’ property). Hyphenation is not applied. This option is used mostly in a context where the text is predominantly using CJK characters with few non-CJK excerpts and it is desired that the text be better distributed on each line.</dd>
____<dt>keep-all</dt>
____<dd>Implicit soft wrap opportunities between letters are suppressed, i.e. breaks are prohibited between pairs of letters (including those explicitly allowed by ‘line-break’) except where opportunities exist due to dictionary-based breaking. Otherwise this option is equivalent to ‘normal’. In this style, sequences of CJK characters do not break.
____</dd>
___</dl>
___<address><a href="http://www.w3.org/TR/css3-text/#word-break-prope … Text Module Level 3</a></address>
__</blockquote>

__<div class="section word-wrap-normal word-break-normal">
___<h3>word-wrap:normal(デフォルト) & word-break:normal(デフォルト)</h3>
<!-- 以下同文
___<form action="./">
____<textarea name="MSG" cols=40 rows=4" lang="ja">テスト中です。
サンプルテキスト!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</textarea>
___<table border="1" width="40">
____<tbody>
_____<tr>
______<td width="40">
_______テスト中です。
サンプルテキスト!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
______</td>
_____</tr>
____</tbody>
___</table>
-->
__</div>

__<div class="section word-wrap-normal word-break-keep-all">
___<h3>word-wrap:normal(デフォルト) & word-break:keep-all</h3>
<!-- 同文にてコピー -->
___</table>
__</div>

__<div class="section word-wrap-normal word-break-break-all">
___<h3>word-wrap:normal(デフォルト) & word-break:break-all</h3>
<!-- 同文にてコピー -->
__</div>

__<div class="section word-wrap-normal word-break-normal">
___<h3>word-wrap:break-word & word-break:normal(デフォルト)</h3>
<!-- 同文にてコピー -->
__</div>

__<div class="section word-wrap-normal word-break-keep-all">
___<h3>word-wrap:break-word & word-break:keep-all</h3>
<!-- 同文にてコピー -->
__</div>

__<div class="section word-wrap-normal word-break-break-all">
___<h3>word-wrap:break-word & word-break:break-all</h3>
<!-- 同文にてコピー -->
__</div>
_</div>
_<div class="footer">
__<h2>文書情報</h2>
__<dl class="documentHistry">
___<dt id="FIRST-PUBLISHED">First Published</dt>
___<dd>2013-03-03</dd>
__</dl>
_</div>
</body>
</html>
    • good
    • 0
この回答へのお礼

ご回答ありがとうございます。
テーブルの決まった幅の中で文章が右端まできたら言語に関係なく折り返すようにしたいと考えています。(禁則文字が行頭に来るような文章でも)。IEの禁則処理が働いてしまうようです。

お礼日時:2014/04/14 23:34

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!