我有下面的代码,当我将它设置为strict时,图像的位置就会发生变化,并向上移动。你可以帮助我理解潜在的问题,在哪里我可以找到不同文档类型之间的这些类型的其他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>发布于 2012-01-30 20:59:14
在怪癖模式和几乎标准模式中,图像(它们是内联内容,因此与字体字符布局在同一组行上)是zero-height positioned at their baseline。
在标准模式下,通过旋转生成图像的vertical-align属性或将其设置为display: block,可以获得相同的效果。
发布于 2012-01-30 21:01:30
我希望更改您的doctype会将某些版本的internet explorer的操作模式从标准模式更改为兼容模式。Internet explorer (在其他方面)更正了它解释边界框模型的方式,但能够根据DOCTYPE在旧方法和更正后的方法之间切换。
https://stackoverflow.com/questions/9064180
复制相似问题