(X) 书名的 HTML 标记

发布于 2024-07-23 12:22:02 字数 60 浏览 4 评论 0原文

书名是否应该包含在 中? 标签? 如果不是 有更合适的标记吗?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

习ぎ惯性依靠 2024-07-30 12:22:02

肯定是错误的。 除了我之前给出的其他建议(例如 RDFa 或语义类名称)之外,请考虑使用

来自 HTML 5 草案:

cite元素代表标题
作品的一部分(例如一本书、一篇论文、
散文、一首诗、一首乐谱、一首歌、
剧本、电影、电视节目、游戏、
雕塑、绘画、剧院
制作、戏剧、歌剧、
音乐剧、展览等)。 这个可以
是被引用的作品或
详细引用(即
引文),或者它可以只是一个作品
这是顺便提到的。

<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.

落墨 2024-07-30 12:22:02

我将使用 RDFa 与任何标签。 RDFa 规范允许您在 HTML 中添加一些语义。 例如,您的标题将使用 Dublin-Core 属性 dc:title. 进行注释

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.

寒江雪… 2024-07-30 12:22:02

这实际上取决于上下文。他们甚至可能使用标签,具体取决于您显示书名的方式和位置。 如果您将其显示在书籍列表中,则可以使用带有

的定义列表。 标签作为书名,
作者的标签。

对于一本书来说确实没有“语义正确”的标签,但是您可以创建一个易于阅读且有意义的标记。

<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>

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>
吲‖鸣 2024-07-30 12:22:02

对于像书名这样传达语义信息的东西,答案是否定的。 您应该执行类似以下操作:

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

然后使用 CSS 根据需要设置 BookTitle 样式。

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.

梦言归人 2024-07-30 12:22:02

以下是我一直在开发的 HTML5 语义标记网站的示例,该网站使用 http 中指定的最近接受的微格式: //schema.org 以及 HTML5 的新的更多语义标记元素。

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

Google 有一个方便的语义标记测试工具,可以向您展示它如何看待该页面。恐怕您必须在 google 上搜索它,因为我只允许在我的代表处发布一个链接。 :(

更新:这是链接 http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fblog-to-book.com%2Fview%2Fstuff% 2Fabout%2Fsemantic+web&view=

希望这能为您指明一些有趣的方向。如果您需要更详细的标记,那么“良好关系本体论”几乎是我目前能想到的最全面的本体论。

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.

缺⑴份安定 2024-07-30 12:22:02

怀疑是这样。 从语义上讲,“em”的意思是“强调”而不是“斜体”。

嗯,HTML 缺少很多东西,所以我要么只使用通用的 Foobar 或者如果我觉得疯狂的话我会发明我自己的标签(谁说我不能?它将通过定制的 DTD 完美验证,或者我可以使用 XSLT 来转换文档)。

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).

Oo萌小芽oO 2024-07-30 12:22:02

对于 等标签,w3schools.com 声明“它们并未被弃用,但可以通过 CSS 实现更丰富的效果。” 所以我想说它适合书名,除非您更喜欢使用 CSS 进行所有文本格式设置(就像我一样)。

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).

作业与我同在 2024-07-30 12:22:02

语法规则规定书名(或其他“长”作品的标题)应使用斜体或下划线。 因此,该标签是合适的。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文