Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作成中の新しいWebサイトがあり、CSSは、スペースがある場合は常にh2タグ内のテキストを強制的に折り返します。ここにサイトがあります:
そして、ここに問題があります:
「LowFees」をスペースなしでまとめ、さらに数文字(「LowFeesABC」)を追加すると、一緒になって折り返されません。私はCSSをよく知らないので、テキストをまとめる方法を知ることができません。何か案は?
#topPanel h2 { white-space: nowrap; }
https://developer.mozilla.org/en-US/docs/CSS/white-space
要素に固定幅が設定されており、「LOW FEES」というテキストがその幅に収まらないため、折り返されます。取り外すだけwidth:90pxでラッピングが削除されます。
width:90px