If you develop a web page nowadays, you don’t use
br tags, right? Or do you? And if you do, is it wrong, or the most efficient and pragmatic way to implement a desired line break in some text?
Let’s take a look at this from a number of perspectives:
The idealist would say that the web is a living medium, and to have predefined line breaks is just futile. Just use paragraphs, and your text will wrap where its containing element ends.
The designer would say that a line break after that exact word with that exact font will look “oh-so-good!” and fit perfectly into their vision for the web site design. They want good copy writers who can choose words that end just in time to suit into their design.
The editor/the copy writer
The people responsible for writing the text want to find the perfect flow in it, and often rely on a delicate balance of words. They want line breaks where they think it will strengthen the impression and readability of the text. They’re also used to WYSIWYG tools where they themselves can decide whether to create a new paragraph or a line break (for instance, by holding down Shift in certain editors).
The web developer
The web developer will say: just make up your minds so I can code this (unless he/she is an idealist :-))!
So, who’s right?
All of them! That’s the thing, isn’t it? A web site is made up by many people and their specific skills, qualities and interests they have to protect, and in the end, it is often about finding the perfect compromise and usage for the context in which the text will be shown. In general, one situation where I’d say that it’s okay to have fixed width and line breaks is in short-lived campaign web sites.
But for more “regular” web sites, I’d argue against the designer that with elastic/fluid web site layouts and the end user having the possibility to change the text size in their web browser, it is impossible to guarantee a fixed font size and where automatic line breaks will occur. And if think you can solve that with a line break, that might end up in the middle of a paragraph, completely ruining the initial idea of the line break.
What code to use?
If it is a demand/decision (perhaps made by the people paying your salary at the end of the day) that it should be a line break at a certain location, how do we code it then? Do we use a
br tag, or do we create two separate paragraphs where the one with the line-broken text can have a class removing its top margin, making it look like just a line break (for instance,
<p class="additional-text">The text on a new line</p>)? Or should we have
pre tags for any text that we want full control over?
Personally, I’d start by ruling out the
pre tag. It’s not really intended for this scenario, in my opinion. Whether
br tags or
p tags with classes are best, I can’t really say. My gut feeling tells me that if a line break is really, really necessary, a line break is probably the way to go, though.
What’s your take? Line breaks or paragraphs? Or perhaps another solution that I haven’t thought of?