Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-25-2012, 11:59 PM   #1
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 569
Karma: 2673214
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
CSS - How big is TOO big?

When I've converted books, the CSS usually ends up with 30 - 40 items (those books have illustrations, drop-caps, quoted letters & publications, embedded fonts, and sometimes tables).
My current project already has over 90 CSS items (lots of short stories with lots of different layout needs), and likely to increase.

Should this be a concern? Ought I to start finding ways to pare it down?

Am I worrying for no reason at all?
GrannyGrump is offline   Reply With Quote
Old 11-26-2012, 07:29 AM   #2
PageLab
Connoisseur
PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.
 
PageLab's Avatar
 
Posts: 70
Karma: 515184
Join Date: Sep 2011
Location: Brasília
Device: Kindle3, iPad, Nook, Kobo, Positivo Alfa
I think performance should always be a concern. eReaders generally aren't really powerful machines. A tidy CSS is desirable, for sure, but you should verify the size of your HTML files too. If they are too big, performance will suffer a lot.

To achieve maximum performance, it helps to optimize your code with tools like HTML Compressor, CleanCSS, or Helium.
PageLab is offline   Reply With Quote
Old 11-26-2012, 08:21 AM   #3
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 569
Karma: 2673214
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
So far I have always worked with Sigil (code the tags in Notepad++ first because I customized the syntax coloring, using a lot of autohotkey scripting for auto-typing).
I always make a separate file for each chapter / story, so that keeps the file size down.

I will give those tools a try and see what happens. Thanks for the suggestions.

What I also need to find out is if there is a recommended maximum number of classes in a CSS. One thing that is a contradicting issue is that everyone says "don't use empty paragraphs with nbsp;, style a div or a paragraph to make a larger top margin." But maybe I only need that style one time, and further down the page I need a different one-time style, etc. And before I know it, I have a dozen styles with one-time use. (well, not all for top margins, but just in general). Any advice for that scenario?
GrannyGrump is offline   Reply With Quote
Old 11-26-2012, 09:21 AM   #4
DSpider
Evangelist
DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.
 
DSpider's Avatar
 
Posts: 418
Karma: 326969
Join Date: Nov 2009
Location: Romania
Device: iPod touch 2G (16 GB)
Quote:
Originally Posted by grannyGrumpy View Post
I have a dozen styles with one-time use. (well, not all for top margins, but just in general). Any advice for that scenario?
Either style them with a master CSS file, or with multiple CSS files, one per each chapter.

Personally, I don't think even the weakest e-reader will have problems with a long CSS file, because it's only loaded when the chapter (the HTML or XHTML file) is loaded, not on each page turn. It can affect page turn only if the chapter is really long (over 300 KB), or chuck full of images. But this is entirely dependant on the e-reader. Some of them pre-cache the next file.

Last edited by DSpider; 11-29-2012 at 02:52 PM.
DSpider is offline   Reply With Quote
Old 11-26-2012, 09:39 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,425
Karma: 43260000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by grannyGrumpy View Post
And before I know it, I have a dozen styles with one-time use. (well, not all for top margins, but just in general). Any advice for that scenario?
Make classes for common scenarios (top margins, left margins, italics, etc...) and then stack them with other classes as necessary (elements can have more than one class). Or make judicious use of the '+' CSS operator to handle special situations rather than creating a ton of classes that only get used once.
DiapDealer is offline   Reply With Quote
Old 11-26-2012, 09:41 AM   #6
PageLab
Connoisseur
PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.PageLab ought to be getting tired of karma fortunes by now.
 
PageLab's Avatar
 
Posts: 70
Karma: 515184
Join Date: Sep 2011
Location: Brasília
Device: Kindle3, iPad, Nook, Kobo, Positivo Alfa
Regarding the use of empty paragraphs: it's good practice to remove them because this separates presentation from structure in your content, and keeps everything related to visual presentation in one place – your CSS. Also, that empty line could be interpreted by screen readers like JAWS, which can be used to read aloud ePUB content in Adobe Digital Editions.
PageLab is offline   Reply With Quote
Old 11-26-2012, 11:31 AM   #7
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 569
Karma: 2673214
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
@DSpider, I do use a master CSS, but this one is getting bigger than I have been used to, and getting hard to remember and use the different bits. I used to try doing individual CSS on each file, but it was so much hassle to edit.

@DiapDealer, I have recently started to use the "+" operator, but I'm not too well-versed on stacking. I've copied some from the gurus' books in the library, and adapted them for my own use, but don't really have a handle on how it works. Do you have a recommendation for a link with tutorial or more information?

@PageLab - I"m trying to be a good little granny and not use empty paragraphs, but golly, they are so tempting sometimes. So far, I've resisted.

Thanks guys, for the input. Much appreciated.

Last edited by GrannyGrump; 11-26-2012 at 11:47 AM.
GrannyGrump is offline   Reply With Quote
Old 11-29-2012, 09:45 AM   #8
Ti-Ron
Connoisseur
Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 1023042
Join Date: Nov 2011
Device: Kobo Touch, iPad
Quote:
Originally Posted by DSpider View Post
(...) with multiple CSS files, one per each chapter.
We can do that!?!?!?!?!

THANKS A LOT for opening my eyes. This is really helpful for my project right now!

Last edited by Ti-Ron; 11-29-2012 at 11:12 AM.
Ti-Ron is offline   Reply With Quote
Old 11-29-2012, 02:51 PM   #9
DSpider
Evangelist
DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.DSpider ought to be getting tired of karma fortunes by now.
 
DSpider's Avatar
 
Posts: 418
Karma: 326969
Join Date: Nov 2009
Location: Romania
Device: iPod touch 2G (16 GB)
Of course. Just define them in the HTML/XHTML file before the <body> tag.

For example:

Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Chapter-5.html</title>
  <link href="../Styles/template_5.css" rel="stylesheet" type="text/css" />
</head>

<body>
...
DSpider is offline   Reply With Quote
Old 11-29-2012, 03:10 PM   #10
Ti-Ron
Connoisseur
Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 1023042
Join Date: Nov 2011
Device: Kobo Touch, iPad
Now that I see it, it's as clear as water, but I didn't think of this solution before!!!!
Thanks for the head's up!
Ti-Ron is offline   Reply With Quote
Old 11-30-2012, 11:40 AM   #11
theducks
Grand Sorcerer
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: 15,100
Karma: 5939999
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
You can also use more than 1 in the same document:
Code:
<head>
  <title>Chapter-5.html</title>
  <link href="../Styles/standard.css" rel="stylesheet" type="text/css" />
<link href="../Styles/template_5.css" rel="stylesheet" type="text/css" />
</head>
'standard' is the general' css
and template 5 is the additional styles needed for this document.
IIRC if a selector duplicates previously defined one (in standard), the last style found is used, so you could even override 'standard'
theducks is offline   Reply With Quote
Old 11-30-2012, 12:57 PM   #12
Ti-Ron
Connoisseur
Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.Ti-Ron ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 1023042
Join Date: Nov 2011
Device: Kobo Touch, iPad
Woah, there's a world of possibility!

I know, I know I'm only an ePub Padawan! "A lot to learn, I have."
Ti-Ron is offline   Reply With Quote
Old 12-08-2012, 06:43 AM   #13
graycyn
Guru
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 832
Karma: 1595268
Join Date: Aug 2010
Location: NE Oregon
Device: Sony T1, Samsung Galaxy Note, Kobo Aura HD, Nook HD+, Nexus 7 (2013)
I think I just learned something too! I was also concerned about my CSS getting too long, but adding stylesheets for specific chapters had not occurred to me. World of possibilities indeed!
graycyn is offline   Reply With Quote
Old 12-08-2012, 07:45 AM   #14
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,086
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
It occurs to me that splitting them up could help the e-readers processing a little. It could keep it from having to process/store a lot of extraneous material that doesn't apply to a particular chapter.
mrmikel is offline   Reply With Quote
Old 12-08-2012, 01:25 PM   #15
exaltedwombat
Evangelist
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 456
Karma: 1703930
Join Date: Nov 2011
Device: none
You can always use inline style code for one-off formatting requirements.

But DON'T GET COMPLICATED! If your book is going to be any use, it must work on a range of devices. For instance, the Nexus 7 is becoming very popular. A commonly-chosen eBook reader for it, Aldiko, seems to ignore quite a lot of stylesheet instructions. It's often best to simply pour in your text, surround it by <p> tags, and let the device decide how it displays.
exaltedwombat is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why did the Big Publishing Houses get so big? fjtorres General Discussions 25 11-13-2012 01:15 PM
Willing to answer questions of publishing - small press, big-six, and big-six. MichaelSullivan Writers' Corner 31 08-21-2012 05:10 PM
Saying Hi and also a big thank you! paratwa Introduce Yourself 5 05-10-2011 01:32 AM
Hi from Big D bthurman Introduce Yourself 5 01-08-2010 09:13 AM
big hello and big hug dongdongliushui Introduce Yourself 5 07-16-2009 03:44 PM


All times are GMT -4. The time now is 06:24 AM.


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