output:
hello How are you
code:
hello
How are you
Ho
as normal, but hide it with display: none when you don't want it.I would expect most people finding this question want to use css / responsive design to decide whether or not a line-break appears in a specific place. (and don't have anything personal against )
While not immediately obvious, you can actually apply display:none to a tag to hide it, which enables the use of media queries in tandem with semantic BR tags.
The quick brown fox
jumps over the lazy dog
@media screen and (min-width: 20em) {
br {
display: none; /* hide the BR tag for wider screens (i.e. disable the line break) */
}
}
This is useful in responsive design where you need to force text into two lines at an exact break.
jsfiddle example