View Single Post
Old 02-26-2018, 11:41 AM   #38
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,303
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I think the main aversion to <br/> is using them to create space between/before/after paragraphs.

Bad:
Code:
<p>Last paragraph in a section with a space following.<br/><br/></p>

<p><br/><br/>First paragraph in a section with space preceeding.</p>

<p><br/></p>  'empty line
That shouldn't imply that it is overall bad coding. The header example above is a perfect situation where it's better to use <br/> than multiple <h#>. I would actually format the header issue slightly differently - just so I could apply slightly different formatting to the author line:

Code:
CSS:
h1 {margin-top: 2em; margin-bottom: 2em; text-align: center;}
h1 span {display:block; font-size:.8em}

Text:
<h1>LOVE AMOUNG<br/>the<br/>CHICKENS<span>by P. G. Wodehouse</span></h1>
or

Code:
CSS:
h1 {margin-top: 2em; margin-bottom: 2em; text-align: center;}
p.auth {font-size:.8em; margin-bottom: 2em; text-align: center}

Text:
<h1>LOVE AMOUNG<br/>the<br/>CHICKENS</h1>
<p class="auth">by P. G. Wodehouse</p>
The first example would keep the "author" line right below the title and apply all the other formatting of the <h1>, while the second example would have a 2em space between the title and author... pick your poison.

In fact, if you want to create a linefeed within the same container - without creating a new container - it is appropriate to use <br/>. GrannyGrump's use of <br/> inside of the <div> is much better/cleaner than the multiple <div> statements. The <br/> is used as a linefeed without having to reapply the container's formatting (margin's, padding, indent, etc), it simply continues on the next line. According to W3Schools "Use the <br> tag to enter line breaks, not to separate paragraphs."

Cheers,
Turtle91 is online now   Reply With Quote