gpt4 book ai didi

html - 使用 CSS3 分别格式化段落

转载 作者:太空宇宙 更新时间:2023-11-04 04:07:02 25 4
gpt4 key购买 nike

使用 CSS3,我可以格式化单个段落 <p>有效地。但是当我需要不同格式的多个段落时,我将我的段落重命名为 <p1><p2> .我可以单独格式化它们,但它没有通过有效性测试。我怎样才能以仍然有效的方式执行此操作?

我目前的操作方式出现以下错误:

Element p1 not allowed as child of element body in this context.
Element p2 not allowed as child of element body in this context.

最佳答案

不要更改元素的标签名称。

为元素添加一个class或一个id以区分它们。

<p class="p1">Paragraph 1</p>

<p class="p2">Paragraph 2</p>

jsFiddle example

关于html - 使用 CSS3 分别格式化段落,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21220810/

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