如何在语义上标记诗歌文本? [英] How to semantically tag poem text?

查看:103
本文介绍了如何在语义上标记诗歌文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

诗歌用什么?




  • pre

  • blockquote

  • 代码

  • 别的什么?


解决方案

不要使用 code (除非电脑代码是诗的一部分)。请勿使用 blockquote (除非你引用一首诗)。



空格/换行符: pre br



您可以使用 pre 元素。规范提供了一个(信息丰富的)示例:


下面显示了一首当代诗歌,它使用pre元素来保留其不寻常的格式,形式这是诗本身的内在部分。

 < pre> maxling 

它有一颗心
很重

我承认失去一只猫
所以爱
$ b $朋友失去到
未知
(夜间)

〜cdr 11dec07< / pre>


但是,我只使用 pre 元素,如果诗包含more而不仅仅是有意义的换行符(例如在这个例子中水平空白是有意义的)。

你有一首简单的诗,我会与 br 元素


br




元素必须仅用于实际上是内容的一部分的换行符。 h3>容器: p

对于大多数诗歌来说, p 元素是正确的候选人(或 p 元素,当然)。该规范有(资料性)示例:


 < p>曾经有一个例子来自Femley,<峰; br> 
其标记质量可疑。< br>
验证器抱怨,< br>
因此,作者感到痛苦,< br>
将错误从标记移至押韵。< / p>


另外


例如,地址也是一个段落,也可以是一首表格,一行或一首诗的一部分。




结构:( 文章数字



视具体情况而定(内容,页面结构等),一个分段元素可能是合适的(在大多数情况下文章



同样取决于上下文, figure 元素可能合适:


在这里,诗歌的一部分用数字

 < figure> 
< p>'Twas brillig,和slithy toves< br>
在wabe中玩过gyre和gimble;< br>
所有mimsy都是borogoves,< br>
和mome raths outgrabe。< / p>
< figcaption>< cite> Jabberwocky< / cite> (第一节)。刘易斯·卡罗尔,1832-98< / figcaption>
< / figure>


但是不要在所有诗歌中使用它们,如果他们的用法正确,真的取决于页面。



其他。 &安培;琐事




What to use for poem?

  • pre
  • blockquote
  • code
  • something else?

解决方案

Don't use code (unless computer code is part of the poem). Don't use blockquote (unless you quote a poem).

white space / line breaks: pre or br

You may use the pre element. The spec gives an (informative) example:

The following shows a contemporary poem that uses the pre element to preserve its unusual formatting, which forms an intrinsic part of the poem itself.

<pre>                maxling

it is with a          heart
               heavy

that i admit loss of a feline
        so           loved

a friend lost to the
        unknown
                                (night)

~cdr 11dec07</pre>

However, I'd only use the pre element if the poem contains "more" than just meaningful line breaks (e.g. in this example the horizontal whitespace is meaningful).

If you have a simple poem, I'd go with the br element:

br elements must be used only for line breaks that are actually part of the content, as in poems or addresses.

container: p

For most poems, the p element is the right candidate (or several p elements, of course). The spec has an (informative) example:

<p>There was once an example from Femley,<br>
Whose markup was of dubious quality.<br>
The validator complained,<br>
So the author was pained,<br>
To move the error from the markup to the rhyming.</p>

Also:

For instance, an address is also a paragraph, as is a part of a form, a byline, or a stanza in a poem.

structure: (article, figure)

Depending on the context (content, page structure, …), a sectioning element might be appropriate (article in most cases).

Also depending on the context, the figure element might be appropriate:

Here, a part of a poem is marked up using figure.

<figure>
 <p>'Twas brillig, and the slithy toves<br>
 Did gyre and gimble in the wabe;<br>
 All mimsy were the borogoves,<br>
 And the mome raths outgrabe.</p>
 <figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption>
</figure>

But don't use these in general for all poems, it really depends on the page if their use is correct.

misc. & trivia

这篇关于如何在语义上标记诗歌文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆