break tag

This is a discussion on "break tag" within the Web Page Design section. This forum, and the thread "break tag are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Apr 27th, 2007, 02:07
Junior Member
Join Date: Mar 2007
Location: Wilts, UK
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
break tag

Hi,
I know this is a really basic question but I am a total beginner.

Is it ok to use the break tag in strict XHTML with the new standards and if so is there a space between the br and the /? ie <br/> or <br /> or maybe something else entirely? Should I use paragraphs instead?

Sorry its so basic.

Last edited by milly; Apr 27th, 2007 at 02:08. Reason: missed a bit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Apr 27th, 2007, 02:50
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

No worries

If you've got text, use the <p> tags. I only use <br /> if I want something to break for a single line. For example:

1020 West Point Dr.
Omaha, NE 57105
United States

For that... I would use <br />. Just about anything else I use <p>.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 27th, 2007, 12:21
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Quote:
Originally Posted by Ryan Fait View Post
No worries

If you've got text, use the <p> tags. I only use <br /> if I want something to break for a single line. For example:

1020 West Point Dr.
Omaha, NE 57105
United States

For that... I would use <br />. Just about anything else I use <p>.
But you wrap it in <address> element tho right Ryan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Apr 27th, 2007, 15:36
Junior Member
Join Date: Dec 2006
Location: London
Age: 20
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Quote:
Originally Posted by Ryan Fait View Post
No worries

If you've got text, use the <p> tags. I only use <br /> if I want something to break for a single line. For example:

1020 West Point Dr.
Omaha, NE 57105
United States

For that... I would use <br />. Just about anything else I use <p>.
Agreed, I always use <br /> for line breaks, I never seem to use more then one together. (<br /><br />)
I always have break between r and / as it's just good coding practice.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Apr 27th, 2007, 23:56
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Quote:
Originally Posted by karinne View Post
But you wrap it in <address> element tho right Ryan
Oh, I learned something new today!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Apr 28th, 2007, 00:20
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

I learned something new too!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Apr 28th, 2007, 03:04
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

personally I try and avoid break tags... it's nothing that can't be done using CSS and it just seems like a back-door way of adding style to my content.

What if I later chose that I wanted all addresses to be displayed on one line, or that I wanted the line spacing widened? It would be much easier to change a single definition in my CSS, than possibly a whole lot of HTML. A rubbish example, I know - but it still feels like cheating to me!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Apr 28th, 2007, 13:00
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Snow can you give an example of how you would do an address with html/css?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Apr 28th, 2007, 15:10
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

I'd use something like:
Code: Select all
   <address>
     <p>3 Housey House,</p>
     <p>Townytown,</p>
     <p>Place,</p>
     <p>RFN92 9GN</p>
   </address>
Then just use:

Code: Select all
address p {}
to change it...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Apr 28th, 2007, 15:30
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

I don't think that would typically work for me then...
I usually give my p tags a margin-bottom of 20px to break up paragraphs.

However if I did #address.p that might work???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Apr 28th, 2007, 15:55
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Code: Select all
p {margin:20px;}
address p {margin:0px;}
the styles cascade - so it should work fine
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Apr 28th, 2007, 17:31
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Thanks snow... I'll try that from now on..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Apr 28th, 2007, 17:45
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

That's horrible code! An address doesn't consist of three paragraphs. Semantics people! I'd do a negative line-height before adding p tags.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Apr 28th, 2007, 19:22
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

lol, it was just an example - I've not really had to put addresses on the sites I've produced... but what would you do if you wanted to display the address on one line?

but I would never want to use a <br/> tag anywhere on my site - it just doesn't seperate the style and content...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Apr 28th, 2007, 19:25
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

I really can't think of any reason why I would want this:

1020 West Point Dr. Omaha, NE 57105 United States

I see what you're saying, but if you use the break tag correctly, you won't ever need CSS to change its looks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Apr 28th, 2007, 19:44
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

but you couldn't do this, could you?

Code: Select all
address p{text-indent: 25px;}
address p+p {text-indent: 35px;}
address p+p+p {text-indent: 45px;}
address p+p+p+p {text-indent: 55px;}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Apr 28th, 2007, 19:48
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

I can't imagine why I would ever want to, but use spans if it's necessary.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Apr 28th, 2007, 19:52
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

haha; spans, divs; whatever - the question is whether a br is part of the content or style... for me I would always consider it styling, but while the W3C remains silent on the issue, it's open for interpretation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Apr 28th, 2007, 20:05
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

Never think of content as style; it's always a shut and closed case. As for an address, <br /> is the right way to do it. You need to think of the way it looks without any CSS. Again, semantics!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #20  
Old Jul 9th, 2007, 02:55
Junior Member
Join Date: Mar 2007
Location: Wilts, UK
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: break tag

I tried putting address lines into <p>'s - the code wouldn't validate (XHTML strict) so I had to take the <p>'s out and use <br />
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags