w3cからの定義:
通常の空白の シーケンスは単一の空白に折りたたまれます。テキストは必要に応じて折り返されます。これはデフォルトですPlayit»
nowrap 空白のシーケンスは単一の空白に折りたたまれます。テキストが次の行に折り返されることはありません。
タグが見つかるまで、テキストは同じ行に続きます。
では、なぜそれが浮いた要素の見た目にそれほど大きな違いをもたらすのでしょうか?
たとえば、これを比較します。
<table>
<thead>
<tr>
<th>
<div style="background-color: lightblue; width: 600px; white-space: normal;">
<span style="display: inline-block; height:20px; background-color: red; margin: 5px 3px;float: left;">
Button
</span>
<span style="display: inline-block; height:20px; background-color: red; margin: 5px 3px;float: none;">
Button
</span>
<span style="display: inline-block; height:20px; background-color: red; margin: 5px 3px; float:right;">
Button right
</span>
<div style="clear: both" />
</div>
</th>
</tr>
</thead>
<tbody>
<tr><td>note: white-space is normal here</td></tr>
</tbody>
</table>
上記と同じコードですが、今回は空白のみです:nowrap;
誰かが手がかりを得ましたか?
[編集]
人々が違いを見ることができないとコメントしたので、私は問題のある空白のスクリーンショットをアップロードします:nowrap私はfirefox10.0.4にいます