Quote:
Originally Posted by foosion
One issue with <p> is distinguishing paragraphs with a text-indent and those without. Some CSS defines <p> with a text-indent and then has a class="noindent", typically for the first paragraph of a section, while others define <p> without an indent, then add a class="indent" for every paragraph other than the first.
Is one of these more canonical?
|
There is no such thing as canon when it comes to writing CSS. There are many ways of getting the same results and all are equally valid. There is no one true way.
Generally, I try to use the naked tag for the more common case so I would use p for the indented paragraphs and p class="noindent" for the less common scenario though I've seen several uses of the :first-child pseudo-class. My general preference is for simpler CSS where possible.
The only "canonical" item when it comes to paragraph indents is that you can use indents or spacing between paragraphs. Do not use both.