-1

我读过必须块引用包含段落或段落必须包含块引用?,所以我明白为什么blockquotes 可以包含p元素本身。但是,我认为这原则上不应排除 ablockquote可能恰好在 ap元素中。毕竟,p里面的 sblockquote是相对于引用文本的段落,但是为什么引用的文本不能成为包含文档的更大段落的一部分呢?

请参阅以下内容

<p>This is a paragraph</p>

<p> This is another paragraph: with a &lt;blockquote&gt; in it
<blockquote>some long quote</blockquote>
which (notice the lower case <i>w</i>) I write something about here, so it makes sense I'm not starting a new parapgraph, imho.
</p> <!-- this very editor highlights "p>" in red -->

4

2 回答 2

2

如果块引用恰好在段落<p>标签中,可以吗?

不。

blockquote 元素的开始将隐式结束 p 元素。

这就是为什么 p 元素的结束标记显示为红色的原因:它没有匹配的开始标记,因为该元素已经关闭。

p { background: yellow; }
<p>This is a paragraph</p>

<p> This is another paragraph: with a &lt;blockquote&gt; after it
<blockquote>some long quote</blockquote>
and this isn't inside a paragraph as you can tell because the CSS doesn't give it a yellow background
</p> <!-- this very editor highlights "p>" in red -->

于 2022-01-06T08:38:36.807 回答
-1

请参阅有关如何使用的标准blockquote。允许在引号p内,但反之则不行。但是,您可以在文章或部分中使用块引用。

话说回来。我不相信任何浏览器会介意你做任何你喜欢的事情。浏览器就是这样。

于 2022-01-06T08:39:12.390 回答