View Full Version : <Title> Tag


fcoulter
07-27-2010, 12:01 AM
OK, I'm creating an ePub in Sigil, a collection of short stories.

Every story is in it's own .xhtml file rather than creating the one big file that everyone complains about.

When I create a new .xhtml file and I look at the code (before sticking anything in the file), this is what I see:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

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

<body>
<p>&nbsp;</p>
</body>
</html>

Everything I type ends up between the <body> tags. What (if anything) goes between the <title> tags? Do they do anything?

If I put the name of the short story (or chapter or whatever) between the tags, do they do anything? Will it change the title bar of the eReader to reflect the name of the current short shory or chapter?

What's the story?
:help:

theducks
07-27-2010, 01:22 AM
OK, I'm creating an ePub in Sigil, a collection of short stories.

Every story is in it's own .xhtml file rather than creating the one big file that everyone complains about.

When I create a new .xhtml file and I look at the code (before sticking anything in the file), this is what I see:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

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

<body>
<p>&nbsp;</p>
</body>
</html>

Everything I type ends up between the <body> tags. What (if anything) goes between the <title> tags? Do they do anything?

If I put the name of the short story (or chapter or whatever) between the tags, do they do anything? Will it change the title bar of the eReader to reflect the name of the current short shory or chapter?

What's the story?
:help:

Maybe :D
Not all readers do anything with these.
Some smaller screens have char count limits. Stay Terse :rofl:
I think they don't cause problems if they exist.

Jellby
07-27-2010, 05:35 AM
As far as I know, there's nothing defined to be done with the <title> of each XHTML file, and all implementations I've seen just ignore it. It could conceivably be used in a status bar or something, but more it's likely that would be taken from the ncx file or from "oeb-page-head" elements.

There is some use, however. If you convert the file to PDF with prince, you can define what to do with the <title>, and use it as a running header, for instance, but that's very specialised.

quillaja
07-29-2010, 02:10 AM
I think the <title> tag in the xhtml is ignored most of the time in epub reader implementations. If you're worried about it, stick the book's name in, but leaving it blank is probably fine too.

fcoulter
07-29-2010, 07:53 AM
So basically it's useless overhead. Oh well. I was hoping that it did something useful.

Hatgirl
07-30-2010, 08:48 PM
I stick in whatever I would expect to see in a standard browser title bar, so that if I ever need to quick-convert the ePub to HTML, it'll be already set up.

Yeah, I'm crazy. What of it? :p