简体   繁体   中英

How to avoid wrapping text in CSS

I have a new website I'm building and the CSS forces any text inside h2 tags to wrap whenever there is a space. Here 's the site:

And here's the problem:

If I put "Low Fees" together without a space, and even add a few characters ("LowFeesABC"), it stays together and doesn't wrap. I don't know CSS well enough to know how to keep the text together. Any ideas?

#topPanel h2 {
    white-space: nowrap;
}

https://developer.mozilla.org/en-US/docs/CSS/white-space

It wraps because the element has a fixed width set on it and the text ”LOW FEES” does not fit into that width. Simply removing width:90px removes the wrapping.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM