Quote:
Originally Posted by JSWolf
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.