gpt4 book ai didi

html - 文档类型和 CSS

转载 作者:太空狗 更新时间:2023-10-29 16:02:37 25 4
gpt4 key购买 nike

我有以下带有 doctype transitional 的代码,但是当我将它设置为 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>

最佳答案

在 quirks 模式和几乎标准模式下,图像(内联内容,因此与字体字符位于同一组行上)为 zero-height positioned at their baseline .

您可以在标准模式下通过调整生成图像的 vertical-align 属性或将它们设置为 display: block 来获得相同的效果。

关于html - 文档类型和 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9064180/

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