View Single Post
Old 04-23-2012, 10:12 PM   #6
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
To fully answer this question. Yes, self closing tags (a and div elements in this example) is perfectly valid according to the EPUB spec. The following example conforms to the EPUB 2 spec.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title/>
</head>

<body>
<p>
  <a id="blah" />
</p>

<div id="blah1" />

<div id="blah2" class="clearfix" />
</body>
</html>
The relevant sections of the EPUB 2 Spec are 1.4.1.2 and Appendix A. XHTML 1.1 does allow self closing tags as used above. Specifically Appendix a requires that the document validate against the XHTML 1.1 DTD.
user_none is offline   Reply With Quote