html - 为什么 .css 文件没有改变字体系列?

标签 html css hyperlink

我有一个访问 style.css 文件的 .html 文件:

<html>
  <head>
    <link rel = "stylesheet" href = "../style.css"/>
  </head>
  <body>
    <p>
      This is it.
    </p>
  </body>
</html>
这是 style.css 文件:
  GNU nano 4.8                /var/www/html/style.css                           
body {
  margin: 0;
  font-family: Arial;
  text-align: center;
}
a {
  font-size: 50px;
  margin: 5px 10px 5px 0px;
}
h1 {
  margin: 10px;
  font-size: 100px;
}
p {
  font-family: Arial;
  font-size: 55px;
}
我知道 .html 文件正确链接到 .css 文件,因为文本在中间对齐并且字体大小为 80px,但字体系列不是 Arial,它是默认的 Linux Mint 字体。
如果我在 .html 文件中使用 < style > 标签,并更改字体系列,它会发生变化,但由于某种原因,在使用 .css 文件时它不会发生变化。

最佳答案

这是一个非常奇怪的问题。如果我使用本地 ip (127.0.0.1),它不会在任何页面上使用 Arial,但在实际网站上,一切都是 Arial。由于它在技术上有效,我不会提示,但如果你知道这是为什么,请评论:)

关于html - 为什么 .css 文件没有改变字体系列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67941590/

相关文章:

jQuery 或 CSS 显示外部页面的缩略图

javascript - 如何从表格(由 div 组成)中制作标题是静态的还是固定的

html - 如何在 iframe 中创建相对于父 URL 的链接

javascript - 如何在 CSS 中使链接居中?

javascript - 有时返回 false 不起作用

javascript - 如何将输入文本作为参数传递给 javascript onblur 事件?

html - CSS Sprite 重复图像

html - Firefox 上的错误 : checkbox hidding when i'm scrolling

html - 将鼠标悬停在带有 CSS 的链接上查看动画

javascript - 推特 Bootstrap : modal dialogue tabs