View Single Post
Old 02-26-2018, 03:30 PM   #42
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,355
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
Quote:
Originally Posted by JSWolf View Post
Multiple divs like that are ugly. Why would you use them where p is best?
Here's good code...

.noindent {
text-indent: 0;
}
div.center {
text-align: center;
margin-top: 1em;
margin-bottom: 1em;
}

<div class="center">
<p class="noindent">FOR SALE</p>
<p class="noindent">FRESH BLUEBERRIES</p>
<p class="noindent">INQUIRE WITHIN</p>
</div>


That is just as bad as worse than the multiple <div>s. If you insist on having separate paragraphs...which are unnecessary and semantically incorrect...then at most you would use:

Code:
div.center   {margin:1em auto}
div.center p {text-align:center; text-indent:0}

<div class="center">
<p>FOR SALE</p>
<p>FRESH BLUEBERRIES</p>
<p>INQUIRE WITHIN</p>
</div>
However, you would need to expand your styling of div.center p to remove all the unwanted formatting of your normal <p>....so it is much simpler/cleaner to use:

Code:
div.center {margin:1em auto; text-align:center; text-indent:0}

<div class="center">FOR SALE<br/>FRESH BLUEBERRIES<br/>INQUIRE WITHIN</div>
It would certainly throw a (minor) wrench in the argument if Hitch is correct about some readers not honoring <br/>....but the back of my noodle says that had to be those readers not honoring <p><br /></p> (or any blank line - thus the bad technique of using <p>& nbsp ;</p>), they still render <br/> when properly used.

Last edited by Turtle91; 02-26-2018 at 03:39 PM.
Turtle91 is offline   Reply With Quote