Copy link to clipboard
Copied
I need to create these lines above and below a chapter title in ID. I can create a simple underline UNDERNEATH the text but what about above it? Once done corrdctly I have to export the doc as an epub and want to make sure there is good spacing.
Ha.
Add the parameter "width: min-content;" to the CSS definition. This does not work in Kindle (my usual end point) but does work in my two primary test EPUB readers.
(EPUB is secondary for me, so if it doesn't work in Kindle, I tend to forget about it.)
And if you want some slight extension of the lines beyond the text, add small amounts of left and right padding.
—
Copy link to clipboard
Copied
Some Possibilities in Paragraph Styles:
Copy link to clipboard
Copied
Assuming that's a single paragraph, use the rule above and the rule below in the paragraph style definition.
Copy link to clipboard
Copied
Unfortunately, no. ID does not export Rule Above and Rule Below to EPUB. The settings are discarded.
The only way to do a rule above and/or below is with Paragraph Border, and the only parameters that will be exported are line type and width. Line types are limited to those available in HTML/CSS, so it's best to stay with the simple types if you use anything but solid.
Since ID does not export padding, at all, in any style or setting, the spacing of the lines above and below the text (and to the sides, if used) will be a default amount that cannot be adjusted from within ID. In other words, you pretty much take what ID chooses to give and that's that.
All of this can be tweaked — extensively — with CSS adjustment of the style. Anything that can be achieved on a web page or other HTML document can be achieved by adjusting the "border" values for the style at the CSS level.
—
Copy link to clipboard
Copied
Added rules looks great but does NOT export to epub. I had an underline BEFORE adding the rules. I removed underline and added the two rules but it does not export to epub Reflowable
?????
Copy link to clipboard
Copied
Paragraph Rules do not export, as I said.
Paragraph Borders do, with limitations.
Underlines do export, again with some limitations.
This is a good and simple place to learn basic CSS enhancement of EPUB exports, and that will allow you to get almost any export effect you like.
—
Copy link to clipboard
Copied
I forgot about that. And yes, I agree completely about learning CSS. There's just about nothing you can tweak with it.
Copy link to clipboard
Copied
It's one of the few fairly basic formatting options that simply does not work on EPUB export. Most work, to some degree; the complete lack of export for Rules and limited export for Borders is... perpetually misleading.
But to make this thread useful, here's the basic fix:
The basic code is:
p.STYLENAME {
border-top: solid 2px black;
border-bottom: solid 2px black;
padding-top: 10px;
padding-bottom: 10px;
}
Change STYLENAME to match the style you're attempting to adjust. Retain the p. prefix. It must match spelling and capitalization EXACTLY, and replace any spaces with hyphens. (If the name isn't exact, following those rules, it will do nothing.)
Change the line types, widths, and padding offsets in the code, and save, to adjust the result.
Repeat until happy. 🙂
—
Copy link to clipboard
Copied
Curious...why define it as a p with a class when you could use h1 since it's a chapter heading only?
Copy link to clipboard
Copied
Because everything is defined as p. by default unless you reassign it in the export menu. I doubt that's been done here. (It is a good idea, to impose HTML structure on the export, for accessiblity and other reasons. But keeping it simple here.)
—
Copy link to clipboard
Copied
OK now using paragraph borders, exported in Epub but border lines go across entire page. I do not see any adjustment in the css in the epub.
??
Copy link to clipboard
Copied
Here is the css for that style as it is
p.STYLENAME { border-top: solid 2px black; border-bottom: solid 2px black; padding-top: 10px; padding-bottom: 10px; }
Copy link to clipboard
Copied
Yes, width control is another issue. It doesn't always have good solutions, as HTML/CSS doesn't have any integral "text width" elements.
I can't bring to mind how I've solved this in the past. Give me a bit.
Also, it looks like you're on top of the CSS, but you are changing the style name, there? It should be p.Main-Title-Border in the added file, just as it is in the original. You can also break out the border elements if you want to keep your defined color, etc.
More in a bit.
—
Copy link to clipboard
Copied
Ha.
Add the parameter "width: min-content;" to the CSS definition. This does not work in Kindle (my usual end point) but does work in my two primary test EPUB readers.
(EPUB is secondary for me, so if it doesn't work in Kindle, I tend to forget about it.)
And if you want some slight extension of the lines beyond the text, add small amounts of left and right padding.
—
Copy link to clipboard
Copied
Hi, I was trying to put a spacer with keyline using CSS border with out any text being involved:
p.Space-Keyline {
Border-bottom: solid 2px #2e70a8;
Margin-top: 40px;
Margin-bottom: 40px;
}
This works but only if I put a space in on my indesign document. If I just format a paragraph with no content the css ignores it? is this the correct way of doing it. Thanks!
Copy link to clipboard
Copied
HTML in general ignores empty paragraphs. Put a hard space in the paragraph (using Ctrl-Alt-X; for an HTML <p> </p> result) and you should get the result you want.
Another approach is to attach the keyline to a variant body text style and tag each appropriate paragraph in the doc that way. That is:
Copy link to clipboard
Copied
Great! thanks for your help.