0

由于我在我的 html 文件中添加了 bootstrap 和 font awesome,所以之前完成的大部分 css 都消失了(背景色、google 字体)

<head>
    <meta charset="utf-8">
    <title>Games</title>
    <link rel="stylesheet" href="main.css">  
    <link rel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

    <link href='https://fonts.googleapis.com/css?family=Orbitron:400,500' rel='stylesheet' type='text/css'>       
    <link href='https://fonts.googleapis.com/css?family=Homemade+Apple' rel='stylesheet' type='text/css'>
</head>

有人知道为什么吗?谢谢!!

4

1 回答 1

0

将您的main.css文件声明移动到您的引导程序和字体真棒声明之后。由于 CSS 是级联的,以后的样式会覆盖您的自定义样式。

<head>
    <meta charset="utf-8">
    <title>Games</title>
    <link rel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

    <link href='https://fonts.googleapis.com/css?family=Orbitron:400,500' rel='stylesheet' type='text/css'>       
    <link href='https://fonts.googleapis.com/css?family=Homemade+Apple' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" href="main.css">  
</head>
于 2016-04-27T00:30:45.860 回答