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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
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
Reply With Quote

  #2 (permalink)  
Old Apr 27th, 2007, 02:50
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
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>.
Reply With Quote
  #3 (permalink)  
Old Apr 27th, 2007, 12:21
karinne's Avatar
SuperMember

SuperMember
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
Reply With Quote
  #4 (permalink)  
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.
Reply With Quote
  #5 (permalink)  
Old Apr 27th, 2007, 23:56
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
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!
Reply With Quote
  #6 (permalink)  
Old Apr 28th, 2007, 00:20
SuperMember

SuperMember
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!
Reply With Quote
  #7 (permalink)  
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
Send a message via MSN to snow
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!
Reply With Quote
  #8 (permalink)  
Old Apr 28th, 2007, 13:00
SuperMember

SuperMember
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?
Reply With Quote
  #9 (permalink)  
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
Send a message via MSN to snow
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...
Reply With Quote
  #10 (permalink)  
Old Apr 28th, 2007, 15:30
SuperMember

SuperMember
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???
Reply With Quote
  #11 (permalink)  
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
Send a message via MSN to snow
Re: break tag

Code: Select all
p {margin:20px;}
address p {margin:0px;}
the styles cascade - so it should work fine
Reply With Quote
  #12 (permalink)  
Old Apr 28th, 2007, 17:31
SuperMember

SuperMember
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..
Reply With Quote
  #13 (permalink)  
Old Apr 28th, 2007, 17:45
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
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.
Reply With Quote
  #14 (permalink)  
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
Send a message via MSN to snow
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...
Reply With Quote
  #15 (permalink)  
Old Apr 28th, 2007, 19:25
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
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.
Reply With Quote
  #16 (permalink)  
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
Send a message via MSN to snow
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;}
Reply With Quote
  #17 (permalink)  
Old Apr 28th, 2007, 19:48
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
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.
Reply With Quote
  #18 (permalink)  
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
Send a message via MSN to snow
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
Reply With Quote
  #19 (permalink)  
Old Apr 28th, 2007, 20:05
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
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!
Reply With Quote
  #20 (permalink)  
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 />
Reply With Quote
Reply

Tags
beginners, break tag, html

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easter break unitedcraig Webforumz Cafe 6 Mar 19th, 2008 12:19
<li> elements break in IE7 pesho318i Web Page Design 1 Mar 4th, 2008 16:17
We need you to break this tie -- Vote Now! Marc Entry, Nominations and Voting 13 Jan 30th, 2008 14:42
Line Break DregondRahl Web Page Design 6 Jun 12th, 2007 15:33
Break the Grid kevrapley Introduce Yourself 3 Jun 7th, 2004 09:01


All times are GMT. The time now is 17:44.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43