【发布时间】:2012-02-22 06:22:06
【问题描述】:
我有以下带有 doctype 过渡的代码,但是当我将其设置为严格时,图像的位置会改变并向上移动。您能否帮助我理解潜在问题以及在哪里可以找到不同文档类型之间这些类型的其他 CSS 冲突的列表。
请注意,我知道很少有 HTML 标记在严格模式下不可用,但我特别关注 CSS 冲突。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<style type="text/css">
span.check:before { content: url("http://i41.tinypic.com/2rxea7d.png"); }
</style>
<table>
<tr>
<th>Ruby on Rails</th>
<td><span class="check"></span></td>
<td><span class="check"></span></td>
<td><span class="check"></span></td>
<td><span class="check"></span></td>
</tr>
<tr>
<th>Road on Rails</th>
<td><span class="check"></span></td>
<td><span class="check"></span></td>
<td><span class="check"></span></td>
<td><span class="check"></span></td>
</tr>
</table>
</body>
</html>
【问题讨论】:
-
在 FX 9.0.1 和最新的 Chrome 中,但不确定其他版本。
-
doctype 使事情区分大小写,包括您的 id 和类的名称,并可能解释为什么 doctype 会弄乱您的 css