【发布时间】:2012-06-01 10:50:18
【问题描述】:
我猜我需要一个 doctype,因为以下字体样式只会在 Safari 和 Chrome 中显示我想要的样式。所以每次我添加 HTML5 文档类型时,我的自定义字体都会消失。我是一个业余编码员,所以请随意使用代码,我自学的。
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8"/>
<style type="text/css">
#yolk {
background-image: url(Yolk.png);
background-repeat: no-repeat;
background-position: center top;
padding-top:250px;
}
body {
background-color:#000000;
}
#lol {
background-image: url(lol.png);
background-repeat: no-repeat;
background-position: center top;
padding-top: 100px;
padding-bottom: 100px;
}
@font-face {
font-family: my_font;
src: url('http://myurl.com/lolfont.eot');
src: url('lolfont.eot'), url('lolfont.ttf') format('opentype');
}
p {
font-family: my_font;
color: de0000;
text-align: left;
font-size: 50px;
line-height: 10%;
text-indent: 350px;
}
</style>
<title>yolk</title>
</head>
<body>
<div id="yolk"></div>
<center>
<embed allowScriptAccess="never" src="http://swing.awardspace.com/newcoun… width=320 height=110 wmode=transparent menu=false></embed>
</center>
<p>test</p>
<a href="http://www.google.com" title="lol"><div id="lol"></div></a>
</font>
</html>
【问题讨论】:
-
"我猜我需要一个 doctype,因为下面的字体样式只会在 Safari 和 Chrome 中出现我想要的样式。所以每次我添加 HTML5 doctype 时,都要使用我的自定义字体dissapears" - 因此,当您添加 doctype 时,字体样式会消失。这就是为什么你需要一个文档类型?等等,什么?
标签: html css browser cross-browser compatibility