gpt4 book ai didi

html - CSS 继承 : parents and childrens' children

转载 作者:太空宇宙 更新时间:2023-11-04 04:34:41 26 4
gpt4 key购买 nike

任务:在“注释”类的任何段落内的有序列表中强调强调的文本。这是我目前所拥有的...

.note>p>ol>em{text-decoration:underline;}

我正在努力让它继续下去。我的代码有什么问题?

***编辑:我也试过这个无济于事:

.note p ol em{text-decoration:underline;}

***edit:这是我用来测试它的 HTML...

<div class = "note">
<p>
Modifiers are sometimes included along with the basic command, inside...
</p>

<table align ="center" border = "3" >
<td>
<p>Three things:
<ol type = "i">
<li><em>First</em></li>
<li>Second</li>
<li>Third</li>
</ol>
</p>
</td>
</table>
</div>

最佳答案

你不能,因为 HTML 无效。 OL 不能是 P 的 child 。

http://www.w3.org/TR/html-markup/p.html

A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, hr, menu, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is not an a element.

所以

<p class="note">
<ol>
<li>One</li>
<li><em>Two</em></li>
<li>Three</li>
<li>Four</li>
</ol>

<p class="note"></p>
<ol>
<li>One</li>
<li><em>Two</em></li>
<li>Three</li>
<li>Four</li>
</ol>

基本相同

关于html - CSS 继承 : parents and childrens' children,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16611966/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com