Quote:
Originally Posted by deback
You should also change the <p> for the nonindented paragraphs to something like: <p class="noindent"> and don't use the <div> line at the top. It's best to assign a class to each kind of paragraph, etc. One for indents (the common indent is 1.2em, not 2em) and one for nonindents.
|
My preference is to use combinators and do not use, what are to me, unnecessary classes on tags. In my stylesheet.css I have
Code:
p {
margin: 0;
padding: 0;
text-indent: 2em;
}
dl + p,
hr + p,
header + p,
p:first-child,
table + p {
margin-top: 1.0em;
text-indent: 0em;
}
The plus means "immediately following", so no indent after a dl, or after an hr, or after a header (I wrap h tags in header tags), or after a table, and p:first-child I think means the first one in whatever it's inside of (body, div, etc.). I do have a .noindent class but I rarely use it; most of my p tags, as well as all of the others, are naked. This also ensures consistency and I don't have to worry about having forgotten to add a class to a tag.