gpt4 book ai didi

html - 字体未链接或嵌入但控制台没有错误

转载 作者:行者123 更新时间:2023-11-28 14:42:10 26 4
gpt4 key购买 nike

body{
font-family: "open sans";
}

这就是我对字体的全部了解。 head 标签内没有链接,css 内没有font face,我预计控制台 (Chrome) 会出现一些错误。

但是控制台是清楚的。检查它显示的任何元素 font family: "open sans"(继承自 body)。

是不是浏览器自己安装了open sans

最佳答案

基础知识

  • 控制台仅调试 JavaScript,CSS 静默失败。
  • CSS linters 可用。
  • “Open Sans”字体可从 Google Fonts获得 -- 要加载它们,请将以下内容放在 <head> 中:
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
  • 接下来将以下 CSS 规则集放入外部样式表或 <style> 中 block (注意:值用引号括起来,90% 的时间是标题大小写(即每个单词的第一个字母大写)):
/* This is the most basic of requirements -- see demo for a better set of CSS rules */
selector {font-family: 'Open Sans'}

演示

<!doctype html>
<html>

<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style>
html {
font: 400 16px/1.5 'Open Sans';
}

body {
font-size: 1.1rem
}
</style>
</head>

<body>

<h1>Open Sans</h1>
<p>Apparently we had reached a great height in the atmosphere, for the sky was a dead black, and the stars had ceased to twinkle. By the same illusion which lifts the horizon of the sea to the level of the spectator on a hillside, the sable cloud beneath
was dished out, and the car seemed to float in the middle of an immense dark sphere, whose upper half was strewn with silver.</p>

</body>

</html>

关于html - 字体未链接或嵌入但控制台没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52751567/

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