How can you force text within an element to not wrap, and have the element's width still determined by its contents (instead of manually setting width)?
Example:
On this page you can see a green button with the text "Get Started". For smaller screen sizes, the text wraps. How can I prevent this?
https://pleth-test.herokuapp.com/
I tried using overflow
and text-wrap
CSS properties, but couldn't get anything to work.
将此添加到您的CSS:
white-space: nowrap;
white-space:nowrap
或white-space:pre
。
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.