![]() |
#1 |
Member
![]() Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
|
Which one to apply: HTML tagging or CSS stylesheets?
When composing a text-only ebook using a simple text editor, do you apply HTML tagging or CSS stylesheets throughout?
|
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Stylesheets all the way.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
|
(A) I suppose I need to create only one CSS stylesheet using a simple text editor as I am only creating one EPUB ebook?
(B) How do I link the CSS stylesheet to the text-only document that will become the EPUB ebook? An example would be helpful. (C) Do I use CSS3 or CSS2? |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 11
Karma: 10
Join Date: Sep 2014
Device: Kindle DX, Kindle Fire HDX 7", iOS (iPhone and iPad)
|
A few thoughts:
1) The stylesheet is linked to the html files in the <head> section <head> .... <link href="../../styles/default.css" rel="stylesheet" type="text/css"/> </head> 2) Have you considered using Calibre or Sigil to edit the ebook rather than a simple text-editor? (They give you full control over the html.) The upside is that with the tools: dealing with the spine, toc.ncx, and inline TOC is much easier. And the debug tool is very handy. 3) CSS3 is a superset of CSS2. What CSS3 features are you considering (and have you checked that ereaders support it)? |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
I would strongly recommend an editor like Sigil. Also, keep it on CSS2 (and ePUB2) for better compatibility.
Keep in mind that it is strongly recommended to keep the XHTML file below 280k. Especially older readers have a limit there. Rule of thumb is a XHTML file per chapter. With a stylesheet you have much, much better control. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
There are also a couple of dedicated authoring systems for fiction/script writers that offer ePub export. |
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
If you're using any sort of media query via CSS3 make sure it's in a separate CSS file.
|
![]() |
![]() |
![]() |
#8 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,016
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() You can always save (export) your CSS to use with your next book ![]() A CSS can be very simple if you set the most used attributes p { the style for the bulk of the body paragraphs} p.a_special_case {when different from the base} <p>A normal paragraph</p> <p class="a_special_case">This may be an all bold-italic paragraph</p> see how simple your code could be ![]() |
|
![]() |
![]() |
![]() |
#9 | ||
Member
![]() Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
|
Quote:
Quote:
Is there a list of ereaders that support CSS3 features? |
||
![]() |
![]() |
![]() |
#10 |
Member
![]() Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
|
|
![]() |
![]() |
![]() |
#11 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
It's a way of telling the reading device to load a CSS file based on the screen size or orientation
Here is a good article to explain further into the subject: http://epubsecrets.com/media-queries-in-epubs.php Here is an example of a book using media queries: https://code.google.com/p/epub-sampl....epub&can=2&q= Why would you want to move those to a separate file? some ebooks readers does not have support for these queries and disregard the entire file because of that, you don't want all your eBook CSS disregarded because of one media query the device doesn't like. |
![]() |
![]() |
![]() |
#12 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,665
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
ADE 2 and ADE 3 do not work with media queries. I cannot speak about ADE 4 as I've never installed it.
|
![]() |
![]() |
![]() |
#13 |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
neyet:
Don't take this the wrong way, but you're not remotely close to the media-query stage yet. That's a bit more advanced in terms of understanding ePUBs, how they work across devices, etc. At the stage you're at, you really ought to be taking HTML and CSS classes or tutorials (so you would know how to link an ePUB document with a CSS sheet, for example), and worry about the more-advanced things like media-queries later. Ditto embedding audio--really, that's something that you learn to do later, after you've learnt to make a clean, functioning ePUB file. (n.b.: 99.99% of all ePUB readers won't play any embedded audio.) And, guys: Really, we should be linking him to Pablo's Tutorial. Here, neyet--this will get you started: https://wiki.mobileread.com/wiki/EPub_Tutorial Hitch |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom CSS Stylesheets for Calibre's Viewer | Ralob | Viewer | 389 | 11-24-2024 11:10 AM |
Is it possible to apply CSS to Sigil generated TOC? | carogray | Sigil | 20 | 10-28-2013 11:11 AM |
html css question | holdit | Sigil | 3 | 12-17-2012 11:55 AM |
CSS: Styles for <cite> won't apply | kevlin | Sigil | 4 | 01-11-2012 12:29 PM |
eReader apps that do use embedded CSS 'stylesheets' | jttraverse | Android Devices | 7 | 05-20-2011 12:28 AM |