gpt4 book ai didi

html - 为什么这个 XHTML 无效?

转载 作者:太空宇宙 更新时间:2023-11-03 19:54:31 25 4
gpt4 key购买 nike

为什么这个 XHTML 无效?HTML:

<h2>earthquake warning <span>Posted 03/11/2009 at 2.05pm</span></h2>

CSS:

h2 {
font: bold 20px Arial, "Helvetica Neue", Helvetica, Geneva, sans-serif;
padding-bottom: 5px;
padding-top: 5px;
text-transform: uppercase;
}

h2 span {
font-weight: normal;
text-transform: none;
display: inline;
}

最佳答案

更多的是将h2放在span中。

完整来源:

<span class="warning">
<h2>Bushfire warning <span>Posted 03/11/2009 at 2.05pm</span></h2>
<p class="warning" />Dignissim elit quod dolore sollemnes iriure. Ut suscipit nunc laoreet lectorum facilisi. Consequat eodem consequn congue humanitatis. Vel in litterarum odio solissi. <a href="#">For more information click here.</a>

</span>

您不能将 h2 放在 span 标签内。尝试使用 div 代替:

<div class="warning">
<h2>Bushfire warning <span>Posted 03/11/2009 at 2.05pm</span></h2>
<p class="warning" />Dignissim elit quod dolore sollemnes iriure. Ut suscipit nunc laoreet lectorum facilisi. Consequat eodem consequn congue humanitatis. Vel in litterarum odio solissi. <a href="#">For more information click here.</a>

</div>

关于html - 为什么这个 XHTML 无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1760280/

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