View Full Version : W3 Validation Error (noob question)
grannyGrumpy 02-19-2013, 11:50 PM I've used Flight Crew and EpubCheck many times, but this was my first time to use the W3C service.
Flight Crew and epubCheck report "No errors found"
but W3C gives me this message:
Error:
URI : TextArea 1
Value Error : margin Parse Error [empty string]
Warning:
URI : TextArea 1
No declarations in the rule
The CSS entry is:
@page {margin: 5pt;}
What have I done wrong, and how do I fix it?
Thanks for any advice.
dgatwood 02-20-2013, 12:13 AM Which W3C validator? You mean this one?
http://jigsaw.w3.org/css-validator/
or this one?
http://validator.w3.org
or some other validator? My best guess would be that the validator you used doesn't have proper support for @ rules, but that's just a guess.
grannyGrumpy 02-20-2013, 12:50 AM I used the one available through the Sigil interface, which is the first link you provided.
Oh, and in the printout of the stylesheet, it listed that @page rule as follows:
@page { }
So it stripped out the existing margin rule. It does the same with any margin declaration(margin-top, margin-left, etc.)
I'm baffled.
Toxaris 02-20-2013, 02:46 AM You can safely ignore that. The online validator doesn't like the @page. I assume that it is an addition of IDPF and not official part of the CSS2 (or CSS2.1) specs.
Jellby 02-20-2013, 06:12 AM It's completely valid in CSS2: http://www.w3.org/TR/2008/REC-CSS2-20080411/page.html#page-box
and CSS2.1: http://www.w3.org/TR/CSS21/page.html#page-box
and, of course, CSS3: http://www.w3.org/TR/css3-page/#page-box-page-rule
grannyGrumpy 02-20-2013, 11:53 PM Toxaris and Jellby, thank you for relieving my concern. It is weird to think that the validators which are suppose to help us, are hindering instead.
dgatwood 02-21-2013, 02:13 AM Don't worry. Adobe Digital Editions doesn't like some @ rules, either. :D
Oh, and if you haven't yet, be sure to test your EPUB in ADE. If it acts like your stylesheet failed to load, that's probably why.... I seem to recall moving all my @ rules to a separate style file except for the @font-face rules because they made ADE a sad reader.
grannyGrumpy 02-21-2013, 03:56 AM @dgatwood, yes I do always check with ADE (v 1.8), also with my Sony or with Sony Reader for PC.
So far I have been lucky, and my stylesheets have always loaded and worked ok (well, unless I have silly typos in them). But I will surely keep your comment about separate stylesheets in mind, if it ever comes to one that is really stubborn. Thanks.
Toxaris 02-21-2013, 01:44 PM Don't worry. Adobe Digital Editions doesn't like some @ rules, either. :D
Oh, and if you haven't yet, be sure to test your EPUB in ADE. If it acts like your stylesheet failed to load, that's probably why.... I seem to recall moving all my @ rules to a separate style file except for the @font-face rules because they made ADE a sad reader.
Really? Both my reader as ADE have no issues with @page or @font-face. They have sometimes issues with the font defined in the @font-face. That is easily helped by setting the OS/2 version setting of the font to version 3 in Fontforge (thanks Diap!).
dgatwood 02-21-2013, 08:45 PM Really? Both my reader as ADE have no issues with @page or @font-face. They have sometimes issues with the font defined in the @font-face. That is easily helped by setting the OS/2 version setting of the font to version 3 in Fontforge (thanks Diap!).
@font-face works fine. I can't remember if @page worked or not. @media definitely made it angry.
Toxaris 02-22-2013, 02:27 AM @media I have never used before. Don't really see the need if I look at the description at W3. I can imagine that it doesn't like it, but it should just be ignored by ADE.
dgatwood 02-22-2013, 03:05 AM @media I have never used before. Don't really see the need if I look at the description at W3. I can imagine that it doesn't like it, but it should just be ignored by ADE.
Should, but doesn't, last I tried. ADE also breaks if you do this:
filter:alpha(opacity=0);
Granted, it's probably overkill to support IE-compatible styles in an EPUB book, but FWIW.... ;)
JSWolf 02-22-2013, 08:11 PM @page works fine with ADE.
I actually like @page. I think it's best to set the ePub to no margins and use @page to define the margins you want. That way, it's dead easy to change the margins as wanted.
|