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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 12-05-2012, 06:14 PM   #1
kamanza
Connoisseur
kamanza began at the beginning.
 
Posts: 98
Karma: 10
Join Date: Jan 2011
Device: none
CSS validation error

Converting books to epub in Calibre produces 2 CSS files, one of which (page_styles) doesn't pass CSS 3 validation:

Quote:
URI : TextArea
2 Value Error : margin-bottom Parse Error [empty string]
3 Value Error : margin-top Parse Error [empty string]


Warnings (1)
URI : TextArea
4 No declarations in the rule


Valid CSS information
@page {
}
How should page margins be defined in order to comply with CSS 3 specifications?
kamanza is offline   Reply With Quote
Old 12-05-2012, 09:36 PM   #2
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: 14,500
Karma: 5567061
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by kamanza View Post
Converting books to epub in Calibre produces 2 CSS files, one of which (page_styles) doesn't pass CSS 3 validation:



How should page margins be defined in order to comply with CSS 3 specifications?
margin-right: 0; is valid
margin-left: ; is not
If you don't want/need to specify any, remove the words (or comment out)
theducks is offline   Reply With Quote
Old 12-06-2012, 12:26 AM   #3
kamanza
Connoisseur
kamanza began at the beginning.
 
Posts: 98
Karma: 10
Join Date: Jan 2011
Device: none
Apparently I wasn't clear about the contents of the Calibre-generated page_styles.css:

Code:
@page {
	margin-bottom:5pt;
	margin-top:5pt
	}
kamanza is offline   Reply With Quote
Old 12-06-2012, 12:39 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,797
Karma: 4998511
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://www.w3.org/TR/css3-page/#margin-boxes
kovidgoyal is offline   Reply With Quote
Old 12-06-2012, 01:30 AM   #5
kamanza
Connoisseur
kamanza began at the beginning.
 
Posts: 98
Karma: 10
Join Date: Jan 2011
Device: none
According to everything I read on www.w3.org, the above Calibre .css should be all right. Could it be a bug in the validation service?
page_styles.css works OK in ADE.
kamanza is offline   Reply With Quote
Old 12-06-2012, 03:05 AM   #6
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 651
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Which validator are you using? I use http://validator.idpf.org/ and this does not report any errors with calibre's page_styles.css.
Agama is offline   Reply With Quote
Old 12-06-2012, 06:48 AM   #7
kamanza
Connoisseur
kamanza began at the beginning.
 
Posts: 98
Karma: 10
Join Date: Jan 2011
Device: none
I use the CSS validation tool in Sigil, which redirects to W3C validation service.
kamanza is offline   Reply With Quote
Old 12-06-2012, 04:24 PM   #8
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 651
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
When I submit page_styles.css to W3C I get a different message to the one you get. It says that margin-top and margin-bottom do not exist in CSS3 (but do in CSS1 and CSS2). You can use the "More Options" button in the W3C validator to select CSS2 instead.

Can Sigil be configured to use a different validator? The IDPF tool is specifically for ePub 2 and 3 documents whereas the W3C tool is for CSS in general.

Last edited by Agama; 12-06-2012 at 04:31 PM.
Agama is offline   Reply With Quote
Old 12-07-2012, 07:48 PM   #9
kamanza
Connoisseur
kamanza began at the beginning.
 
Posts: 98
Karma: 10
Join Date: Jan 2011
Device: none
But if you check the CSS 3 reference page on W3schools
http://www.w3schools.com/cssref/default.asp, you'll find all the usual margin properties.
Could it be that CSS 3 doesn't allow margins for paged media?
Very strange.
kamanza is offline   Reply With Quote
Old 12-07-2012, 11:07 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,797
Karma: 4998511
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
CSS 3 has a completely different specification for page margins, see the link I posted before.
kovidgoyal is offline   Reply With Quote
Old 12-08-2012, 09:22 AM   #11
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 651
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Agreed, the CSS3 margin spec is quite different.

@kamanza:

CSS3 does support paged media and @page, but regarding ePub 2 & 3, the IDPF documentation says:

Quote:
EPUB 3 defines a profile of CSS based on CSS 2.1 with added modules from CSS3, whereas EPUB 2 was based on a specific subset of CSS 2.
So it looks like ePub3 does not support all of CSS3. Therefore an ePub2/ePub3 validator looks more appropriate than a CSS validator. Alternatively you could use the option button on the W3C validator to use CSS 2.1.

Conclusion: Calibre's style sheets are fully compliant with the ePub specification.

Last edited by Agama; 12-08-2012 at 09:27 AM.
Agama is offline   Reply With Quote
Old 12-12-2012, 02:21 AM   #12
kamanza
Connoisseur
kamanza began at the beginning.
 
Posts: 98
Karma: 10
Join Date: Jan 2011
Device: none
Thanks for the explanation. Seems, the question has to be transferred to the Sigil forum:
the wrong CSS validator.
kamanza 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
Validation Error Adjust ePub 3 07-21-2011 12:06 AM
Validation error dezignlady ePub 4 07-20-2011 02:34 AM
Question about validation and items referenced in css ldolse Sigil 9 02-02-2011 04:17 AM
Error during validation macdafydd ePub 19 12-01-2010 06:07 PM
Validation error rrosenwald Calibre 10 10-01-2010 11:12 AM


All times are GMT -4. The time now is 06:16 PM.


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