开发者

Why is blockquote element not inheriting parent p's styles?

开发者 https://www.devze.com 2023-04-08 20:21 出处:网络
I have very very simple HTML: <p> <blockquote> </blockquote </p> The p element has a rule in an external stylesheet to define the font-family and co开发者_Go百科lor, yet when t

I have very very simple HTML:

<p>
<blockquote>
</blockquote
</p>

The p element has a rule in an external stylesheet to define the font-family and co开发者_Go百科lor, yet when the blockquote is inside the p, the blockquote is not inheriting any of the p's styles. This is in IE 9.

Why is this?


You cannot have a blockquote inside a paragraph.

Since the end tag for a paragraph is optional, the following means:

<p>            <!-- Start paragraph -->
<blockquote>   <!-- Blockquote forbidden inside p. End paragraph. Start blockquote -->
</blockquote>  <!-- End blockquote -->
</p>           <!-- End paragraph. Paragraph not open. Error. Ignore. -->
0

精彩评论

暂无评论...
验证码 换一张
取 消