HTML/Font/客户端渲染差异:修订间差异
来自康健生活
创建页面,内容为“== 引言 == == Windows 与 Mac 渲染差异 == 在一次项目功能检测过程中,测试和设计反馈页面样式在排版中的位置有异常,经过简单测试检测出是相同字体以及样式在 Windows 与 Mac 系统下渲染存在差异。示例如图。 {| class="wikitable" |- | Mac || 示例 |- | 400px|Font-os-mac-style |}” |
|||
| (未显示同一用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
== 引言 == | == 引言 == | ||
== Windows 与 Mac 渲染差异 == | == Windows 与 Mac 渲染差异 == | ||
在一次项目功能检测过程中,测试和设计反馈页面样式在排版中的位置有异常,经过简单测试检测出是相同字体以及样式在 | 在一次项目功能检测过程中,测试和设计反馈页面样式在排版中的位置有异常,经过简单测试检测出是相同字体以及样式在 Windows(Chrome V-111.0.5563.64 x86_64)与 Mac(Chrome V-108.0.5359.126 x86_64)系统下渲染存在差异。示例如图,可以直观看到在 Mac 系统下字体整体偏上。 | ||
{{codetab|tabs=<tabs><tab name="html"><syntaxhighlight lang="html5"> | |||
<div class="box"> | |||
<div class="text">请输入文本</div> | |||
</div></syntaxhighlight></tab><tab name="css"><syntaxhighlight lang="css">.box { | |||
width: 100px; | |||
height: 18px; | |||
background: #ccc; | |||
} | |||
.text { | |||
height: 100%; | |||
line-height: 18px; | |||
color: #fff; | |||
font-family: "Microsoft YaHei"; | |||
font-size: 16px; | |||
} | |||
</syntaxhighlight></tab></tabs>}} | |||
在不同系统下的展示效果。 | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Mac || | | Mac || Windows | ||
|- | |- | ||
| [[文件:Font-os-mac-style.png|400px|Font-os-mac-style]] | | [[文件:Font-os-mac-style.png|400px|Font-os-mac-style]] | ||
| [[文件:Font-os-windows-style.png|400px|Font-os-windows-style]] | |||
|} | |} | ||
2023年3月17日 (五) 07:48的最新版本
引言
Windows 与 Mac 渲染差异
在一次项目功能检测过程中,测试和设计反馈页面样式在排版中的位置有异常,经过简单测试检测出是相同字体以及样式在 Windows(Chrome V-111.0.5563.64 x86_64)与 Mac(Chrome V-108.0.5359.126 x86_64)系统下渲染存在差异。示例如图,可以直观看到在 Mac 系统下字体整体偏上。
<div class="box">
<div class="text">请输入文本</div>
</div>
.box {
width: 100px;
height: 18px;
background: #ccc;
}
.text {
height: 100%;
line-height: 18px;
color: #fff;
font-family: "Microsoft YaHei";
font-size: 16px;
}
在不同系统下的展示效果。
| Mac | Windows |
|
No categories
