![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jun 2015
Device: none
|
epub validation error
Hello Forum,
I am trying to format a manuscript and I have run into one problem that I have not been able to solve. A simple strike through piece of text. It fails the epub validator (http://validator.idpf.org/) This is the HTML/CSS. Very simple. It displays fine on ereader and browser but fails with error code... ERROR EPUB test.html line 10 position 72 attribute "class" not allowed here; expected attribute "cite" or "datetime" <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <head> <style type="text/css"> html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, pre, table, th, td, tr { margin: 0; padding: 0em; } p {text-indent: 1.5em; margin-bottom: .2em;} </style> </head> <body> <p>I’d just pull out my handy <del>abacus , slide rule</del> , calculator to do my figuring. </p> </body> Everything I've researched says that is valid HTML. All I want is for the specific text to have a strike through. Tag "s" fails also but is being replaced with the newer "del" tags. The cite and datetime are supposed to be optional attributes but the validator seems to be insisting on attributes. Does anybody have a clue why the epub validator is having a problem with this? Is it a validator bug? Thank you so much for any input. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
It is valid HTML, but not valid XHTML. Since ePUB must contain XHTML, it will not work. You should use the following:
Code:
.strike {text-decoration: line-through;} Code:
<p>I’d just pull out my handy <span class="strike">abacus , slide rule</span> , calculator to do my figuring. </p> |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jun 2015
Device: none
|
Toxaris...
Results: Congratulations! No problems were found. You are a wizard. You are awesome. Thank you very much for your prompt help. I implemented your suggestion and it passed the validator. A good lesson learned. I need to pay attention to the X HTML. Have a great day!! |
![]() |
![]() |
![]() |
#4 |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
And IIRC, there's also no requirement in the spec that a reader must render <del> as a strike-through, so even if you were using HTML 5/EPUB 3, you'd still be better off using CSS.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jun 2015
Device: none
|
Thanks dgatwood. That was a great answer from Toxaris and solved the problem.
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ePub Validation Error | sn12 | ePub | 8 | 03-08-2012 11:44 AM |
Epub Validation Error | DTurner | ePub | 6 | 09-12-2011 05:13 PM |
ePub validation error -- what? | Yuroc | ePub | 2 | 08-16-2011 01:29 PM |
Epub Validation Error? | LadyDae | ePub | 6 | 10-29-2010 07:20 PM |
ePub Validation Error | mrbillb | ePub | 6 | 09-28-2010 02:14 PM |