Quote:
Originally Posted by hobnail
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.
|
You have to be very careful using something like p:first-child, as it may not work in some older versions of ADE and in that cases, will cause many people a problem. I could be misremembering. You'd have to test this with ADE 2.0.1. The problem is that ADE is what you have to work with to make sure your code works. If it doesn't work in ADE 2.0.1, then you have to find another way to do what you want.