首页 > 解决方案 > Google Font Roboto + Bootstrap,它们不兼容吗?

问题描述

这是我的头代码:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width">
  <meta name="description" id="description" content="Unisciti alla nostra Community! Condividi le tue idee e trova qualsiasi cosa su One Piece ed altri Anime/Manga!">
  <meta property="og:type" content="website" />
  <meta property="og:title" content="One Piece Power" />
  <meta property="og:description" content="Su One Piece Power potrai trovare qualsiasi cosa riguardande il mondo di One Piece: Episodi, Capitoli, Immagini, Video, Censure, Videogiochi, Guide e tanto altro! Che aspetti! Vieni a visitarci!" />
  <meta property="og:image" content="/images/favicon.ico" />
  <meta name="robots" content="index, follow">
  <meta name="googlebot" content="index, follow">
  <title>One Piece Power</title>
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto&display=swap" async>
  <link rel="stylesheet" href="styles.css" async>
  <link rel="shortcut icon" href="/images/favicon.ico" async>
  <link rel="dns-prefetch" href="onepiecepower.info" async>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <script src="/spoiler.js"></script>

还有我的 style.css

body {
    background-image: url("../../images/sfondo.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #d6c3b1;
    font-family: "Roboto";
    font-weight: bold;
    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

如果我在不导入引导程序的情况下添加此代码,它运行良好,但由于我输入了引导程序导入,它不再工作。

我的网站无法识别网站中的字体roboto。为什么?谢谢

标签: html

解决方案


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="styles.css">

我的网站无法识别网站中的字体roboto。为什么?谢谢

CSS 规范:

最后,按指定顺序排序:如果两个声明具有相同的权重、来源和特异性,则后者指定获胜。导入样式表中的声明被认为在样式表本身的任何声明之前。

顺序很重要,因为当规则发生冲突时,顺序是决定哪一方获胜的一个因素。在这种情况下,无论哪种样式最后声明,都会获得首选项


推荐阅读