<br /> tag seems to get short shrift a lot. Perhaps because it contains no content and appears to have no meaning within a document. You can’t communicate any of the information that a line-break contains structurally because it seems to be a purely presentational element.
Robert Nyman boils the issue down to a number of different perspectives on line breaks: “no”, “yes”, “I don’t know”, and “who cares?” (Perspectives have been paraphrased. A lot.)
I’m not firmly on one side or the other – I can’t help sitting on the fence on this question. There are pieces of information which, to me, seem to be best presented using line breaks. Take an address, for example. You can do it in a single
<address> element without line breaks – and it’s OK, but not really the standard presentation of an address. Most people expect an address to cross multiple lines, after all. Saying we don’t use line breaks, this can be a bit tricky. It seems hardly semantic to put each line of an address into a separate address element – since each line is only a part of the whole.
So using line breaks is pretty standard for an address. Conceivably, a more semantic layout would actually be in definition list format where the definition term is the person’s name and each definition part is the address. This would still require multiple
<address> elements, however, since a single element couldn’t span multiple
<dd> tags, but the address would still require line breaks if used in a single definition element.
So, ultimately, using a definition list may be the most semantic way of expressing an address, but line breaks unquestionably require much less code. The semantic cost is really not too much for me to pay, personally.
I don’t think that a line break has semantic value. However, there are situations where a line break is required because custom dictates it. Other methods of formatting may have their value, but the use of an occasional line break isn’t going to make or break a site’s quality code.
Joe Dolson; October 6, 2010 at 8:28 am
@Kevin Yes, technically the
addresselement is intended to represent information about the author of a document. It can be argued, of course, that if you’re enclosing a full business address, including the business name, that what you’re enclosing is the contact information for the substantive document author. But it’s not entirely accurate.
So it depends, in my view; there are cases when using
addressfor an address is appropriate; but it is not appropriate in all cases.
As far as
brgoes, as I state above, line breaks do carry semantic meaning in the division of content. I think that a
bris appropriate at any point where the text is more easily understood by the insertion of a line break.
In your case specifically, as long as the author of the quote is also wrapped in a
citeelement, I think you’re fine. I’ve done that myself.
Kevin Frey; October 6, 2010 at 3:53 am
I know this is an old post. I was looking for information on the br tag because I’m wondering about citing an author of a quote within the blockquote tag. I thought a line break would make the most sense, particularly because it’s not just the quote author, but also his position, his company, and the date. Commas just don’t seem to do justice when it comes to the aesthetics.
Also, I see some comments about the address tag. It was my understanding that this tag was meant to encapsulate a document’s author information, and not a street address. Is that correct? If it is, does that make using the tag for a street address LESS semantic?
Jeremy; August 23, 2010 at 10:45 am
Just curious, would you consider semantic for code. Even though there is a
tag for this already, is seems more appropriate to me to surround an entire code snippet within a
tag and then each individual line.
Kenny; June 4, 2008 at 7:26 am
I agree with the above statement 100%.
Joe Dolson; January 25, 2008 at 10:45 am
It seems like the point is, ultimately, that there are situations where a
bris the only practical way of creating a needed separation. Barring the creation of numerous new elements to suit every situation where you might need a line break — such as
cityfor addresses, etc. — the only practical means of enforcing an expected line break is
I think the difficulty is largely with a human tendency to perceive that only substance contains meaning:
bris an element which provides meaning through empty space.
Rob; January 25, 2008 at 5:04 am
This is a difficult one. I’m a bit of a CSS (Cascading Style Sheets) purist, but having said that using br tags have remained in my repertoire.
I guess the conclusion is, it’s a personal choice.
Joe Dolson; May 9, 2007 at 1:09 pm
Best way of putting that I’ve heard — clearly, if a passage makes no sense without a line break, it must have a line break. If there is no available markup which makes more semantic sense for the context, a line break is the best semantic choice.
Thanks for your comment!
brandaggio; May 9, 2007 at 1:04 pm
<br>is semantic if your rendered page calls for a line break.
I believe a good way of ascertaining the semantic value of a line break is turning off CSS (Cascading Style Sheets) – at least for those that are skeptical.
There is no “fence” to be on so to speak – either you call for a line break (as you might if using an old fashioned typewriter) or you don’t.
If you actually have something that constitutes a paragraph you of course use the
<p>tag – but unlike a
<br>you wouldn’t do it for the space/break it creates. If you have something that falls short of a
<p>then use a
<span>depending, something that would not imply that what is being wrapped is something it is _not_.
To reiterate, the semantic value of a line break is that it is a break – whatever the context may be – it does not _have_ to be a poem or address, though those are sensible uses for the tag as it were.
There really is no ambiguity about as much as I used to think there was.
Joe Dolson; March 6, 2007 at 3:44 pm
A recent conversation on the GAWDS discussion list brought up a number of interesting points on the break tag, which I thought I’d append here as a comment.
First, some of my own:
Also, Matthew Smith discussed how he feels that the
<br />is a semantic element: (in reference to an address)
And in general:
Others made their own points, but these particularly stood out for me.
Joe Dolson; January 30, 2007 at 10:49 am
@Alfred – I like the way you think! Interesting to imagine a line break as a form of punctuation – a short pause; a breath.
@Karl – Microformats aren’t a bad way to go either. I just prefer a sparser code – unless I have a particular reason to employ microformats, I’m inclined to go for a method which minimizes the amount of code needed (both HTML (HyperText Markup Language) and CSS (Cascading Style Sheets).)
Karl; January 30, 2007 at 7:19 am
Interesting you mention addresses as the example there. I mark them up using Microformats now so whether you wrap the whole lot in an
addresstag or not, you have sufficient CSS (Cascading Style Sheets) hooks to set each span as
display:block;. Semantic with no
Alfred Armstrong; January 30, 2007 at 4:27 am
Line breaks are semantic in poetry. Also sometimes advertising copy has a rhythm to it that demands breaks in particular places. A line break is a form of punctuation, a sort of semi-paragraph.