Opera ラップバグ

StackOverflow https://stackoverflow.com/questions/5309955

  •  24-10-2019
  •  | 
  •  

質問

私はHTML/CSSをフォローしています:

<html>
<body>
<style type='text/css'>
.result_table table {
  border-collapse:collapse;
}
.result_table table td {
  white-space:nowrap;
  max-width:200px;
  overflow:hidden;
  padding:4px;
  max-height:24px;
  height:24px;
}
</style>
<div class="result_table">
 <table border=1><thead><tr><td>Title</td></tr></thead>
  <tbody>
   <tr>
    <td>Lorem ipsum dolor sit amet, ...</td>
   </tr>
  </tbody>
 </table>
</div>
</body>
</html>

「Lorem Impsum」の長さが大きい場合(9000を超えるシンボル)、Opera Browserはテキストをラップし始めます。

enter image description here

他の有名なブラウザはすべて良いことをします:

enter image description here

役に立ちましたか?

解決

可能 overflow-y:hidden 一緒に機能しません display:table-cell オペラで。 o可能な解決策は追加することです display:block 為に .result_table table td.

デモ: http://jsfiddle.net/qxjv8/

別の解決策は、内部でテキストを包むことです td divを使用して、セレクターを変更します .result_table table td div

デモ: http://jsfiddle.net/qxjv8/1/

どちらの場合も、このようなリセットCSSを使用するようアドバイスします。 http://meyerweb.com/eric/tools/css/reset/

また、どちらの場合も、オペラの2行目が部分的に見えることに気付くでしょう。これを解決するには、使用できます line-height 財産。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top