Quote:
Originally Posted by nabsltd
The problem with this is that for any class you assign to a p element, you need to explicitly override every property that you set for the default. For example, since most people like some sort of indent on the general paragraphs, that means you have to remember to override that with an explicit text-indent: 0;. This can be easy to not notice if the "special" paragraph is centered.
My take is that "bare" elements should have all properties set to the default value as defined by the CSS standard. In other words, a normal "CSS reset".
I have seen EPUBs styled with a "bare" div being set as essentially a block quote:
Code:
div {
margin-left: 2em;
margin-right: 2em;
margin-top: 1em;
margin-bottom: 1em;
font-size: 0.9em;
}
This is not a good default for something that is just supposed to be a container that can be styled. Nesting quickly results in an unreadable font size.
|
I prefer to have a blank <blockquote> instead. I've seen a lot of blank <div> that doesn't need to exist. I'd rather not see <div> anywhere. The problem with the CSS (IMHO) is the font size. If it's smallcaps, it's too large. If it's not smallcaps, it's too small.
I use a left/right margin of 1.5em for <blockquote> and I have another class called .blockquote for when a <blockquote> may be the last bit in the chapter so the margin does not maybe run into the next page and cause a blank page. The bottom margin is set to 0.
This is what I use for a naked <p>.
Code:
p {
margin-top: 0;
margin-bottom: 0;
widows: 1;
orphans: 1;
text-indent: 1.2em;
}
I see no reason to add bloat when it's not needed. I don't need <p class="someuselessclass"> when <p> works. Also, it makes the code easier to read.
I prefer no class in most cases where possible except <div> where I think it should have a class to differentiate a <div> I can dump.
For chapter headers, this is what I prefer... <h2>Chapter 01</h2>.