Quote:
Originally Posted by GrannyGrump
So... if I want to style, for example, a "For Sale" sign.
I should style it as such:
<div class="centrd">FOR SALE</div>
<div class="centrd">FRESH STRAWBERRIES</div>
<div class="centrd">ENQUIRE WITHIN</div>
Rather than
<div class="centrd">FOR SALE<br />
FRESH STRAWBERRIES<br />
ENQUIRE WITHIN</div>
I simply do not comprehend why the <br /> is any uglier than multiple <div>s. Plus, you have what might be considered extraneous tags...
Educate me some more, please?
|
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>