Page 1 of 2

<br/>

Posted: Sun Apr 01, 2007 8:58 pm
by JellyFish
Is this tag apart of any standard or is it recommended for use? How else would I break paragraph lines without it?

EDIT: What's it intended for and what's it be mistakenly use for?

Posted: Sun Apr 01, 2007 9:27 pm
by Ambush Commander
<br> is part of the official W3C recommendations and is not deprecated. However, it is commonly used to break up paragraphs, which should be marked up as <p>Paragraph</p>. The br line does not have a commonly agreed upon usage. Some people believe it should be used for things like poetry, where line breaks have specific meaning (some claim that this is incorrect, and you should use <pre> or wait for XHTML 2.0's <l> tag.)

Posted: Sun Apr 01, 2007 9:43 pm
by JellyFish
I guess <br/> shouldn't be use for layout only for line breaking in <p></p> tags.

But isn't breaking in <P> consider layout purposes?

Posted: Mon Apr 02, 2007 3:47 am
by Luke
There is nothing wrong with using the <br> tag. Like Ambush Commander said, you should not use it to break up paragraphs, but for things like addresses, it is necessary I think.

Code: Select all

<p class="address">
 <span class="name">John Eaton</span><br />
 <span class="street">1234 Some Avenue</span><br />
 <span class="locality">Johneaton, Indiana 54321</span>
</p>

Posted: Mon Apr 02, 2007 7:29 am
by feyd
Styled unordered lists can work for addresses, as can they for poetry. Although they may look a bit off in text browsers and are not exactly what lists were meant for. :)

Posted: Mon Apr 02, 2007 8:34 am
by Oren
Unordered list is more appropriate for addresses in my opinion. Why? Because today you want your first name in its own line and your last name in another line, but tomorrow you might want them on the same line.

P.S I still have a conflict here with myself (:P) since I think that a list is not the best thing for this - semantically.

Posted: Mon Apr 02, 2007 9:53 am
by Luke
yea I think I disagree with the use of an unordered list for an address. If you want to mark an address up semantically, use an hcard (thanks, maugy!). :D

Posted: Mon Apr 02, 2007 10:08 am
by Kieran Huggins
Isn't that what the <address/> tag is for?

"The <address> tag defines the start of an address. You should use it to define addresses, signatures, or authorships of documents. The address usually renders in italic. Most browsers will add a line break before and after the address element, but line breaks inside the text you have to insert yourself."

Code: Select all

<address>
Donald Duck<br />
Box 555<br />
Disneyland
</address>
Although I did point you at microformats the other day (and Maugrim as well I see) - I never felt comfortable with them conceptually. They seem like a hack to me, so I don't personally use them.

Incidentally, the above is a fine example of a use for <br/>, though I would start to get worried if I was using it more than once in a while.

Posted: Mon Apr 09, 2007 10:46 pm
by JAB Creations
I use br elements to clear floats inside of containers that would otherwise have visual issues in good browsers like Gecko and Opera.

Code: Select all

<br style="clear: both;" />

Posted: Tue Apr 10, 2007 10:09 am
by Luke
@kieran - yea I kind of agree that they are hacky, but even so, they're still interesting. I'm considering using hCal on a site I'm putting together now. There's really no reason NOT to use them I guess.

Posted: Tue Apr 10, 2007 10:36 am
by RobertGonzalez
I use <br /> tags whenever I need to break a line. That is what they are there for. They are meant tot break lines and other text that is not structured in a way that it is its own paragraph. <p> tags are paragraph tags, used to make paragraphs.

The whole issue of lists... well, that has me torn. On the one hand using lists for navigation is completely aside from the use of the list tag (somewhat, because in reality without CSS a list still makes a good navigation link list) but on the other hand you can do funky shiznit with lists to make them do really cool stuff.

Posted: Tue Apr 10, 2007 10:40 am
by Luke
Everah, what is a menu, but a list of links? I think that using an unordered list for navigation is exactly what lists are for. Not sure what you mean.

Posted: Tue Apr 10, 2007 2:22 pm
by Kieran Huggins
Navigation menus *heart* lists - especially nested, unordered lists.

Posted: Tue Apr 10, 2007 5:18 pm
by RobertGonzalez
The Ninja Space Goat wrote:Everah, what is a menu, but a list of links? I think that using an unordered list for navigation is exactly what lists are for. Not sure what you mean.
In the right context I agree with you. When people make tabbed buttons that hover a hidden div and reveal links associated with a given UL heading, then that is a little outside the scope of a list, in my opinion.

Don't get me wrong. I use them all the time in my designs. They are clearly semantically correct when listing links. I just think in some contexts the list is not truly a list in the way it is implemented.

Posted: Tue Apr 10, 2007 6:47 pm
by JAB Creations
I dislike lists for menus (though used one for version 2.7 of my site just over a year ago). However they aren't accessible! Just using CSS nothing truly is accessible (at the complexity I like to work with) but with JavaScript the menus on the next version of my site (preview http://www.jabcreations.net/) work just great in most modern browsers using just the keyboard and no mouse (tab, space (to open submenus), and enter). And the the developers who are too lazy to press the page down key I'm going to implement a "developer's keyboard" to keep them happy. However since they know how to toy with that stuff it will be the designer keyboard by default. I love this stuff!

Anyway the new menus I use are all divisible elements and we'll have to wait either for XHTML 2 or for some uber DTD editing genius to create a menu element for those serving their pages as application/xhtml+xml which I doubt will happen until I figure that stuff out myself.