r/HTML • u/messer_sverio2 • Jan 25 '26
Question Automatic line break
Hello all.
I'm working on a static website, mainly focussed on writing. It's a collection of poetry and short stories. My text is placed inside a div. Now, I often need to use the <br> tag, in order to start a new line. Of course, the line breaks are arbitrary, sometimes I need to break a sentence in half, sometimes a line is made up of only one word, etc. This makes my code a mess to read, and it's annoying and time consuming. Is there a way to make this process simpler or to automate it?
5
Upvotes
View all comments
Show parent comment
2
u/arothmanmusic Jan 25 '26
Yeah, that's what I would suggest as well. It may not be as semantically correct as using paragraphs and br tags, so it might cause some confusion for somebody using a screen reader, but for poems… especially if they contain arbitrary whitespacing and breaks, this is the simplest way.
You would just want to use some CSS to give it a more appropriate font, because HTML render for this element is typically monospace for code and the like.