Question

Should book titles be contained in an <em> tag? If not <em> is there more appropriate markup?

Was it helpful?

Solution

<em> is definitely wrong. In addition to the other suggestions given before me such as RDFa or a semantic class name, consider using <cite>

From the HTML 5 draft:

The cite element represents the title of a work (e.g. a book, a paper, an essay, a poem, a score, a song, a script, a film, a TV show, a game, a sculpture, a painting, a theatre production, a play, an opera, a musical, an exhibition, etc). This can be a work that is being quoted or referenced in detail (i.e. a citation), or it can just be a work that is mentioned in passing.

OTHER TIPS

It really depends on the context.. They might even use <h1-6>-tags depending on how and where you display the book titles. If you display it in a list of books, you could use a definition list with the <dt> tag as the book title, and <dd> tag(s) for the author(s).

There is really no "semantically correct" tag for a book, but you can create a markup that is easy to read and makes sense.

<dl class="booklist">
    <dt class="book">Book title</dt>
    <dd class="author">The author</dd>

    <dt class="book">Awesomest markup Evah!</dt>
    <dd class="author">HTML Wiz Kid</dd>
    <dd class="author">Tagz are Me</dd>
</dl>

I would use RDFa with any tag. The RDFa specificaton allow you to add some semantic in your HTML. for example your titles would be annotated with the Dublin-Core property dc:title.

Here is an example of a HTML5, semantically tagged website that I've been working on that uses the recently accepted Micro-formats as specified at http://schema.org along with the new more semantic tagging elements of HTML5.

http://blog-to-book.com/view/stuff/about/semantic%20web

Googles has a handy Semantic tagging test tool that will show you how it sees that page You'll have to google it i'm afriad as I am only permitted to post one link at my rep. :(

UPDATE: Here is the link http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fblog-to-book.com%2Fview%2Fstuff%2Fabout%2Fsemantic+web&view=

Hope this points you in some interesting directions. If you're after more detailed tagging, then the Good Relations Ontology is pretty much the most comprehensive I can think of right now.

For something like a book title that conveys semantic information, the answer is no. You should do something like:

<span class="BookTitle">War and Peace</span>

and then use CSS to style BookTitle as you please.

Doubt so. Semantically "em" means "emphasis" not "italics".

Well, HTML lacks a lot of things, so I'd either just use generic <span class="book-title">Foobar</span> or if I'll feel a crazy I'll just invent my own tag (who said I can't? it will validate perfectly with customized DTDs or I may use XSLT to transform the document).

Concerning tags like <em> and <strong>, w3schools.com states that "They are not deprecated, but it is possible to achieve richer effect with CSS." So I would say that it is appropriate for a book title unless you prefer using CSS for all text formatting (as I do).

Grammar rules state that book titles (or the titles of other "long" works) should be italicized or underscored. Therefore, the tag is appropriate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top