View Single Post
Old 08-19-2012, 04:29 PM   #23
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,903
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by starrigger View Post
You mean, say, a centered style based on Normal? Or a centered style based on "Normal No Indent"? I can't see in the attributes where the ancestor is indicated. Here's one:

.Scenebreak {
display: block;
font-family: "Times New Roman", "serif";
font-size: 1em;
line-height: 1.2;
margin-bottom: 3pt;
margin-left: 0;
margin-right: 0;
margin-top: 6pt;
text-align: center;
text-indent: 0
}

(I added the indent 0 line.) I know, in Word, that it's based on Normal, with certain other elements defined, such as no indent, centering, and spacing above and below. But I can't tell that from looking at this part of the CSS.
.Scenebreak {
display: block;
font-family: "Times New Roman", "serif"; <-- can break font changing and not needed
font-size: 1em; <--- can cause a problem with font sizes and not needed
line-height: 1.2; <--- too large a line height and not needed
margin-bottom: 3pt; <-- should be 0 as this causes a paragraph space
margin-left: 0;
margin-right: 0;
margin-top: 6pt; <-- 2em is best
text-align: center;
text-indent: 0
}

5 issues in one style. The code is not clean.


As for centering...

Code:
.center {
margin-top: .5em;
margin-bottom: .5em;
text-align: center;
text-indent: 0
}
Now if you use that like <p class="center"> where <p> is...

Code:
p {
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
text-align: justify;
text-indent: 1.2em
}
Then the center works perfectly with a .5em top and bottom margin for a single line.

If your <p> is like above where is has a text-indent other then 0, then you do have to specify in the class style the text-indent to be 0 or you will get a text-indent of whatever is defined in <p>. Using the above <p>, here's the code for the section break.

Code:
.scenebreak {
margin-top: 2em;
text-indent: 0
}
That's all you need and it works for <p class="scenebreak">.

Last edited by JSWolf; 08-19-2012 at 04:37 PM.
JSWolf is offline   Reply With Quote