The white-space property is used to insert the line break before an element. This property controls the text wrapping and white-spacing.
Line break between the lines: The line break can be added between the line of text. The white-space: preline; is used to insert line break before an element.
Line-break between HTML Elements: The line-break between HTML elements can be added by using CSS properties. There are two methods to force inline elements to add new line.
- Using display property: A block-level element starts on a new line, and takes up the entire width available to it.
- Using carriage return character (\A): We can add a new-line by using the ::before or ::after pseudo-elements.
Example 3: This example uses carriage return character “\A” to add line break before an element.
- What is the difference between “word-break: break-all” versus “word-wrap: break-word” in CSS ?
- CSS page-break-before Property
- CSS break-before Property
- How to break line without using <br> tag in HTML / CSS ?
- How to define a possible line-break using HTML5 ?
- How to set a single line break in HTML5 ?
- How to remove underline from a:before using CSS ?
- How to read a file line by line using node.js ?
- How to write <dt> and <dd> element on the same line using CSS ?
- CSS | ::before selector
- How to write :hover condition for a:before and a:after in CSS?
- CSS pause-before Property
- CSS | box decoration break Property
- CSS | word-break Property
- CSS | page-break-after Property
- CSS | page-break-inside Property
- CSS break-inside property
- How to apply CSS page-break to print a table with lots of rows?
- CSS break-after property
- How to insert spaces/tabs in text using HTML/CSS?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.