Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-28-2014, 04:14 AM   #1
neyet
Member
neyet began at the beginning.
 
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?
neyet is offline   Reply With Quote
Old 12-28-2014, 04:49 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Stylesheets all the way.
Toxaris is offline   Reply With Quote
Advert
Old 12-28-2014, 07:27 AM   #3
neyet
Member
neyet began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
Quote:
Originally Posted by Toxaris View Post
Stylesheets all the way.
(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?
neyet is offline   Reply With Quote
Old 12-28-2014, 09:10 AM   #4
Wendy Wolfe
Member
Wendy Wolfe began at the beginning.
 
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)?
Wendy Wolfe is offline   Reply With Quote
Old 12-28-2014, 09:29 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Advert
Old 12-28-2014, 10:11 AM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by neyet View Post
When composing a text-only ebook using a simple text editor, do you apply HTML tagging or CSS stylesheets throughout?
BTW, if you use Markdown formatting, you can automatically convert your book to the epub format (and a couple of other formats) with pandoc.

There are also a couple of dedicated authoring systems for fiction/script writers that offer ePub export.
Doitsu is offline   Reply With Quote
Old 12-28-2014, 10:27 AM   #7
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
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.
odedta is offline   Reply With Quote
Old 12-28-2014, 12:50 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by Toxaris View Post
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.
to all points


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
theducks is online now   Reply With Quote
Old 12-28-2014, 03:03 PM   #9
neyet
Member
neyet began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
Quote:
Originally Posted by Wendy Wolfe View Post

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.
Do you mean that it is preferable for me to convert my text-only document to an EPUB ebook using Calibre or Sigil and then edit it using the same tool?

Quote:
Originally Posted by Wendy Wolfe View Post
3) CSS3 is a superset of CSS2. What CSS3 features are you considering (and have you checked that ereaders support it)?
I am considering to embed audio.

Is there a list of ereaders that support CSS3 features?
neyet is offline   Reply With Quote
Old 12-28-2014, 03:04 PM   #10
neyet
Member
neyet began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Dec 2014
Device: none
Quote:
Originally Posted by odedta View Post
If you're using any sort of media query via CSS3 make sure it's in a separate CSS file.
What is media query?
neyet is offline   Reply With Quote
Old 12-30-2014, 12:24 PM   #11
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
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.
odedta is offline   Reply With Quote
Old 01-02-2015, 09:59 PM   #12
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: 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.
JSWolf is offline   Reply With Quote
Old 01-03-2015, 06:25 PM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by neyet View Post
What is media query?
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
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:09 PM.


MobileRead.com is a privately owned, operated and funded community.