w3.org's blockquote -page上有两个示例:

Example 14 :

<figure>
    <blockquote>
        "That monster custom, who all sense doth eat
        Of habit’s devil," <abbr title="et cetera">&c.</abbr> not in Folio

        "What a falling off was there !
        From me, whose love was of that dignity
        That it went hand in hand even with the vow
        I made to her in marriage, and to decline
        Upon a wretch."
    </blockquote>

    <footer>
        — <cite class="title">Shakespeare manual</cite>
        by <cite class="author">Frederick Gard Fleay</cite>,
        p19 (in Google Books)
    </footer>
</figure>

Example 19 :
<figure>
    <blockquote>
        <p>
            The truth may be puzzling. It may take some work to grapple with.
            It may be counterintuitive. It may contradict deeply held
            prejudices. It may not be consonant with what we desperately want to
            be true. But our preferences do not determine what’s true. We have a
            method, and that method helps us to reach not absolute truth, only
            asymptotic approaches to the truth — never there, just closer
            and closer, always finding vast new oceans of undiscovered
            possibilities. Cleverly designed experiments are the key.
        </p>
    </blockquote>

    <figcaption>
        <cite>Carl Sagan</cite>,
        in "<cite>Wonder and Skepticism</cite>",
        from the <cite>Skeptical Inquirer</cite> Volume 19, Issue 1 (January-February 1995)
    </figcaption>
</figure>

两者看起来都与我非常相似-在内容方面。但是他们说第一个:



但是,我不理解两个版本之间的区别。有人可以解释一下区别,区分footerfigcaption的重要之处是什么?

最佳答案

基于以下事实:

  • 如您所见,W3C规范中的非规范示例似乎彼此矛盾。
  • W3C规范不包含任何规范性文本,表明任何一个选项都不适当。其中一个示例声称引用不是标题,但由于它不是规范性标题,因此您完全有权不同意。
  • 来自实时规范编辑器this WHATWG issue以及W3C CSSWG(即非HTML WG)成员认为,实际上,区别并不重要,尽管前者似乎倾向于figcaption
  • 实际上,大多数作者还是将归因信息放置在figcaption中,没有明显的影响。

  • ……结论似乎是两者之间没有任何有意义的或实际的区别,而您选择使用的任何一个都是个人喜好问题。

    话虽如此,如果您仍然无法确定,figcaption与这两个规范更兼容,而不是在一致性方面(因为footerfigcaption均符合),而是在它们如何描述其作用和用法方面,尤其是与figure元素相关(通常,您希望与图形关联的文本成为其标题)。无论哪种方式,最重要的是cite元素,因为最终它们是传达属性语义的元素,而不是容器元素。

    关于html - 图: When to use footer,中的blockquote何时使用figcaption?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48638937/

    10-13 01:01