Join Kevin Callahan for an in-depth discussion in this video Style sheets, part of Creating Fixed-Layout Ebooks for the Kindle.
- Style sheets are essential when creating and producing any InDesign document, whatever the finished product will be. If you use paragraph, character, and object styles, your path to producing print mechanicals and their ebook adaptations will be straightforward. We'll be exporting the text in this file to HTML, so we want to make sure that we've used paragraph and character style sheets and checked that there are no overrides. To learn more about creating and applying style sheets, take a look at David Blatner's InDesign CC Essential Training here on lynda.com. Now here in this document, we're going to open our Paragraph Style panel and see that the body dc, body drop cap, because it has that drop cap in there, that's why it's named that, has an override, which you can see from this plus symbol here.
I happen to know that this word "everywhere" is italic, you can see it up there, Roboto Italic, but it doesn't have a character style sheet attached, and that's what's giving us the override. So what we need to do is assign it a character style sheet. We'll say italic, click that, and we've gotten rid of the override. And see, down here in the character style panel, it's also assigned italic. Now, one thing that we can do when we're going through our book to make sure that everything has a style sheet assigned to it, is to just quickly give everything a color that it doesn't really matter whether or not that color is going to print, or be part of the ebook, but if we assign a color to a style sheet, any random color, like make all the text red, and we can scroll through and see if all the text is red, and sure enough, all the text has a style sheet attached to it.
If we want to make sure that all the drop caps have style sheets attached to them, assigned to them, we come to the Edit Drop, we add a character color, we make it blue. We can scroll through and make sure all the drop caps are blue, so we know that all of our drop caps have a blue color assigned. And similarly, we can come to the italic style sheet, edit it, make it green, and there it is, it's green. I think this is the only italic in the book.
Actually, this chuck-chuck-chuck here is italic also, but that's not going to export as text. We'll talk about that later. So let's Command Z to get rid of all these color assignments. Everything's back to their normal colors. So now it seems that everything has a style sheet assigned to it. We can go through quickly and see if there are any overrides. Let's open our Paragraph Style box again. One thing I like to do as I'm going through a book to prepare it for export to EPUB, either HTML or EPUB, is I like to keep all the variables evident to me, so that's why I still have the layer panels showing up, so I can see that the art is on the art layer, text is on the text layer, that way even though I've done all that work already, I can have another look at it as I'm going through to check the style sheets.
It's always good to check things more than once as you're going through because that makes the final export a lot cleaner and a lot more straightforward. Now there's one thing in here I know that we don't want in the HTML export, and those are grep styles. I happen to know that the grep style inside the body tag here-- Let's open that, Edit Body, come down to Grep Style. Now this particular grep style is telling InDesign to keep the last two words in a paragraph on the same line so that we don't have any widows.
That's going to provide some funky export to HTML. We want to get rid of this for the export to HTML. We have other ways to govern line breaks and paragraph width within HTML and CSS and we'll be talking about that a little bit later on. So let's just delete this, say OK. So now that invisible character is out of the InDesign and it will not export to HTML. Now the final thing we need to do before we export, is look at the export tags that will go from InDesign to HTML and CSS.
So we come down here, we Edit All Export Tags, we get this big box here. Show EPUB and HTML. And we look down the left side, we see the InDesign style names. This column here, Tag, is the HTML tag that will wrap around elements within the book. Paragraphs and heads and things like that. Class is the CSS designation that wraps itself around a word or a paragraph that actually defines the style for that word or paragraph. We can see here, for example, that this character style Drop has a span around words that are assigned Drop, and it has a Class of Design.
So when we get to the CSS, we can design the Class called Design to be anything we want, it doesn't have to look like what we have here at all, or it can look exactly like what we have here in (mumbles) presentation. So editing all export tags before you do the actual export goes a long way towards tying your InDesign style sheets to HTML tags and CSS classes. Let's click out of there because that's all set up already. Now the final thing I want to do in this document is address the drop caps.
Kindle devices across the board do not display drop caps in the same way. There's such a large collection of Kindles, from the large tablets to the smaller tablets, to the E Ink devices, to the apps on your iPad or on an Android device, that drop caps don't always behave the same way. So I don't like to use drop caps in Kindle books. So what I'll do here is come back to the style sheet for body drop cap, edit it, come down to the style definition for drop caps, change it from two lines to one, click OK, and now we've lost that big drop cap, and we still have that red design display type going on there.
So what I'm going to do is I'm going to just make the first few words red in that design typeface. So I'll go from there, to here, "she dearly loved fat." It's just sort of at random, whatever the phrase is. Somehow the text moved a little bit. Let's open this box. When I change the drop caps, it moved the text around a little bit, that's not a big deal. "When they were gathered." "Then she went on." "One day the little red hen." These are all getting assigned a character style called Drop, and as we saw in the Edit Export dialogue box, these words will be wrapped in a span, and we'll be able to define that span in the CSS once we get to the HTML side.
So no matter how simple or complex your book is, a good style sheet program is important to making print production, and eventually ebook export hassle-free.
- What is a fixed-layout ebook?
- Good candidates for fixed layout
- Comparing the Kindle format to EPUB3
- Managing fonts
- Inserting images
- Using the Kindle Previewer
- Exporting InDesign documents for Kindle formatting
- Working with the Kindle fixed-layout template
- Using media queries