introduction

Developers usually prefer to break text on a web page. The line break restricts text in one way or another and prevents design problems. Text wrapping can also prevent horizontal scrolling. But there are cases when you want blocks of text to stay on the same line regardless of their length. You can prevent line breaks and text breaks for certain elements with the CSS white-space property.

In this tutorial, you’ll style the same block of text in four different ways, first with a line break and then three times without a line break:

#css

Preventing line breaks with CSS
1.15 GEEK