![]() |
SVG in stylesheet?
Part of the background to this post is that I'm starting to explore how to use SVG images. Another part is that I dabbled with website design in the olden days, and always made sure that the HTML files validated to W3C standards.
I've experimented with a Coverpage.html file adapted from a file which I understand is used by Sigil. But when I checked it with the W3C markup validation service it indicated 11 errors: there is no attribute xmlns, height, preserveAspectRatio, version, viewbox, width, xlmns:xlink, svg, width, xlink:href, and image for this element in this HTML version. I tried using the xhtml 1.0 transitional doctype, but it made no difference. It is easy to put height, width, and image attributes in the stylesheet, but I couldn't manage the others. Is there any way to put them in the stylesheet? or to make the file validate in some other way? |
Try using the Sigil "Add Cover" option -- it will auto-generate a new cover page based on whatever standards were coded into Sigil and using whatever image you select. It is embedded as an SVG.
|
Quote:
I acknowledge that the ebook that I took the file from which my file was made does validate with EPUB-Checker.exe. But I want each and every file in my ebooks to validate. |
Here is a template I always use for cover.html and it validates!
PHP Code:
|
Quote:
I converted your file into an HTML file, and tested it with the W3C markup validation service at http://validator.w3.org/ The validation service gave the warning that there is no doctype, and tested it as an XHTML transitional file. It gave the same 12 errors that I described in a previous post. I realise that my desire to find a way of doing an SVG cover with an individual HTML file which validates to W3C standards may be quixotic, but that's what I want to do. |
Quote:
Why? Why the validation need? Can you clarify it for me? Hitch |
1 Attachment(s)
Quote:
For example, I quickly slapped together a simple ePub with a text based SVG cover image that uses an embedded blackletter font. This ePub passes ePubCheck and displays as expected with ADE and you can easily change the cover text by editing the .svg file in Sigil. Disclaimer: This won't work on any Kindle. |
Quote:
I realise that ePubs are not websites, but I'm too old and set in my ways to change. For what it is worth I don't see much improvement in using SVG wrappers over what I do now. |
Quote:
|
Alex, the validator fails my input because it doesn't have !DOCTYPE element, html files require a DOCTYPE to pass validation of W3Consortium.
If you run it passed ePubChecker it passes the check and that's all that matters as far it goes for eBook validation. |
Quote:
1.4.1.2: XHTML Content Document Requirements A conformant XHTML Content Document must meet these conditions:
Valid XML yes, but the only XHTML mention is the last point. |
Quote:
Dale |
| All times are GMT -4. The time now is 10:57 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.