似乎 Internet Explorer 8、9、10 在这里总是使用相同的(系统)字体。事实上,Internet Explorer 根本不在乎font-family
。重要的是display:table-cell
and :before
or的组合:after
:
<!DOCTYPE html>
<html>
<head>
<style>
body > div {
display: table;
}
body > div > div:before {
font-family: monospace;
display: table-cell;
content: 'Not a monospace font in IE.';
}
</style>
</head>
<body>
<div>
<div>
</div>
</div>
</body>
</html>
这是一个已知的错误?找不到任何关于它的东西。