2016-04-27 76 views
0

自从我加入引导和字体真棒我的HTML文件时,大多数的CSS做之前就消失了(背景颜色,字体,谷歌)添加bootstrap&字体真棒遗迹css为什么?

<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> 

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

+0

您试图更改订单吗? – aldanux

回答

0

将您的main.css文件声明移动到您的引导程序和font-awesome声明。由于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> 
+0

如果引导CSS具有更高的特异性,更改顺序不会有所帮助。 – GolezTrol

+0

@GolezTrol通常,Bootstrap不会使用'!important'正是出于这个原因。 – Steve

+1

我不是在说那个。我说[Specificity](https://css-tricks.com/specifics-on-css-specificity/),这不仅仅是添加'!important'。 (反正你也不应该使用'!important') – GolezTrol