View Full Version : Tagging and styles in ePub


Artha
11-11-2011, 04:14 AM
I am about to start making my first serious ePub. The author gave me some .doc file and I'm about to apply styles to it (it's all done visually). But I think I can use and abuse the HTML tags instead of creating classes.

For example there is a motto at the begining of each chapter. What would you say about styling it as an address for example, instead of a paragraf class motto? Are there disadvantages to use the markup I don't use?

Toxaris
11-11-2011, 07:13 AM
The reading application might not support it. With paragraph classes you are safer.
Also, the visual interpretation of the tags might differ per reading application, giving a non-consistent appearance.

Artha
11-11-2011, 08:03 AM
You are right. It never crossed my mind, although it's that obvious: with the broken support of today tools, better safe than sorry.

As for the display: it should take all description from the CSS file, no?

Toxaris
11-11-2011, 09:51 AM
It should.

dwig
11-11-2011, 11:24 AM
You are right. It never crossed my mind, although it's that obvious: with the broken support of today tools, better safe than sorry.

As for the display: it should take all description from the CSS file, no?

It might ...

... the style descriptions in the CSS are the lowest priority of all style descriptions in the ePUB. When the same tag or class repeats in the several possible style locations (e.g. a margin set on the <p> tag) the style applied directly to the tag in the (x)html body is the one used.

Priority (in order of highest to lowest):

style applied in the tag - <p style="margin-top: 1em;">
style placed in the <STYLE></STYLE> section in the (x)HTML file's <HEAD> section
style placed in the last CSS file linked to in the <HEAD> section
...
style placed in the first CSS file linked to in the <HEAD> section


If there are no conflicts, the style description in the CSS will be used. provided the reader app supports it. When there are conflicts, the CSS looses out to the higher priority style.

Jellby
11-11-2011, 11:59 AM
For example there is a motto at the begining of each chapter. What would you say about styling it as an address for example, instead of a paragraf class motto? Are there disadvantages to use the markup I don't use?

If it is not an address, don't call it an address.

Artha
11-17-2011, 12:20 PM
It might ...

... the style descriptions in the CSS are the lowest priority of all style descriptions in the ePUB. When the same tag or class repeats in the several possible style locations (e.g. a margin set on the <p> tag) the style applied directly to the tag in the (x)html body is the one used.

Priority (in order of highest to lowest):[...]
If there are no conflicts, the style description in the CSS will be used. provided the reader app supports it. When there are conflicts, the CSS looses out to the higher priority style.

Nice to have the list of priorities. But once it's in the CSS, I won't use any inline styles, just for the sake of my sanity.

If it is not an address, don't call it an address.

True Mr. Google. Yet, from a typographical standpoint HTML it's such a bad option and ePub seems to be only part implemented just as the browsers don't bother with all the features listed in W3 docs. As I don't have a motto tag I can use a special paragraph class or reuse some other tag already in. Sure, the drones will have issues harvesting relevant info for their masters, but should that concern me?

JSWolf
11-25-2011, 05:48 PM
Most readers use ADE and ADE works with CSS.

Artha
11-27-2011, 12:11 PM
Actually, from what I gather they don't use the same ADE I can download from Adobe.com. It's an ADE API bundled with whatever was thought useful by the hacker employed to build up the system.

I have discovered first hand that ADE can be quite precise on the standards involved (ex. @include must be before everything even comments). But it's functionality is rather spartan: can't find a way to tweak the CSS according to my [the user] needs. Only a zoom function that involves both font and page size.

JSWolf
11-27-2011, 12:15 PM
Actually, from what I gather they don't use the same ADE I can download from Adobe.com. It's an ADE API bundled with whatever was thought useful by the hacker employed to build up the system.

I have discovered first hand that ADE can be quite precise on the standards involved (ex. @include must be before everything even comments). But it's functionality is rather spartan: can't find a way to tweak the CSS according to my [the user] needs. Only a zoom function that involves both font and page size.

Please explain what exactly it is you are trying to do. And if need be, give CSS/XML samples.