问题描述
我不确定它是什么字体,但是我将其假定为Monotype Corsiva(如果我输入错了,请更正我),这是我当前的CSS似乎不起作用,因为字体没有改变位
I'm not sure about what font it is but I assumed it as a Monotype Corsiva (please correct me if I'm wrong), and here's my current CSS which doesnt seem to work because the font didn't change a bit
CSS:
<div style="font-family:Monotype Corsiva, Times, Serif; background-color:#74b3bc; height:46px; minSize=10;maxSize=100;">
推荐答案
如果您使用的是Google字体,我相信您会找到类似的东西.这是一个使用带有"Cookie"字体的Google网络字体的示例,它非常相似.
If you look on google fonts I'm sure you will find something similar. Here is an example of using Google web fonts with a font called "Cookie" and it is quite similar.
首先将其放在您的页面中...
Firstly put this in your page ...
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ["Cookie:regular"]
}
});
</script>
,然后在您的实际网页中使用它,就像这样将其包含在您的CSS中.
and then to use it in your actual web page include it in your css like so.
body {
font-family: "Cookie"
}
如果您确实检出了Google字体,则可以使用上面的JavaScript代码添加任意数量的字体,只需在每个字体之间加上逗号,并确保它们使用这样的引号即可.
If you do check out google fonts you can add as many as you want using the javascript code above, just simply stick a comma between each font and make sure they are in quotes like this...
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ["Lato:100,300,400,700,900","Karla:regular","Cookie:regular"]
}
});
</script>
和100,300,400,700,900-是字体粗细,因此,在此处声明它可以在CSS中使用它.
and the 100,300,400,700,900 - is the font weight, so by declaring it here you can use it in your css.
为了安全起见,这里是 JSFiddle
and to be safe here is a JSFiddle
享受:)
这篇关于如何使用"Monotype Corsiva"CSS语句中的字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!