I feel like I saw a way, using the CSS content property, to insert a line break tag before an element. Obviously this doesn't work:
#restart:before { content: '<br/>'; }
But how do you do this?
There are many ways to break the line without using <br> tag. The used properties are listed below: white-space: pre; It is used to make elements acts like <pre> tag. display: block; It sets the display property of elements to block.
You can insert line breaks in HTML with the <br> tag, which is equivalent to a carriage return on a keyboard.
The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
The <br> element is used to insert a line break or carriage-return within a parent element such as a paragraph without breaking out of the parent container.
It's possible using the \A
escape sequence in the psuedo-element generated content. Read more in the CSS2 spec.
#restart:before { content: '\A'; }
You may also need to add white-space:pre;
to #restart
.
note: \A
denotes the end of a line.
p.s. Another treatment to be
:before { content: ' '; display: block; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With