Skip to content

Home » dev » <br> not causing a line break

<br> not causing a line break

Abstract

The text in the next paragraph has a line break where indicated. By using CSS to alter the browser default styles associated with this element, the line break can be avoided. This is obviously illogical, but shows what could be done. Only works in Opera 7+.

Example

This sentence has a <br> element at the end of it →.
See how the line doesn’t break in Opera 7+?

Code

br:before {
content: "";
}

Conclusion

With the right browser support, stopping an element that inherently breaks lines, to not cause a line break is possible. As mentioned previously though, this is illogical, and exists only as a proof of concept to show what could be done.

Post a Comment

Your email is never published nor shared. Required fields are marked *

Subscribe without commenting