为什么这个XHTML不是有效的?HTML:
<h2>earthquake warning <span>Posted 03/11/2009 at 2.05pm</span></h2>
Run Code Online (Sandbox Code Playgroud)
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;
}
Run Code Online (Sandbox Code Playgroud)
它更多的是放在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>
Run Code Online (Sandbox Code Playgroud)
你不能把一个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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
230 次 |
| 最近记录: |