![]() |
#1 | |
Zealot
![]() Posts: 115
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:
|
|
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,908
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:
margin-left: ; is not If you don't want/need to specify any, remove the words (or comment out) |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() Posts: 115
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 } |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,195
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#5 |
Zealot
![]() Posts: 115
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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Which validator are you using? I use http://validator.idpf.org/ and this does not report any errors with calibre's page_styles.css.
|
![]() |
![]() |
![]() |
#7 |
Zealot
![]() Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
|
I use the CSS validation tool in Sigil, which redirects to W3C validation service.
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
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. |
![]() |
![]() |
![]() |
#9 |
Zealot
![]() Posts: 115
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. |
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,195
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#11 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
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:
Conclusion: Calibre's style sheets are fully compliant with the ePub specification. Last edited by Agama; 12-08-2012 at 09:27 AM. |
|
![]() |
![]() |
![]() |
#12 |
Zealot
![]() Posts: 115
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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |