<br/>

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

<br/>

Post 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?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.)
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post 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?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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. :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Post 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;" />
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Navigation menus *heart* lists - especially nested, unordered lists.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Post 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.
Post Reply