2015-07-05 142 views
1

我用bootstrap創建了一個非常簡單的頁面。 (我有一個引導組件) 我已經添加了一個額外的css文件,但它不起作用,同時包含bootstrap.min.css。多個CSS文件不起作用

有人知道爲什麼嗎?

我的網頁:

<html> 
<head>  
    <link rel="stylesheet" href="css/mystyle.css" type="text/css"> <-- This won't work 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <-- while this is included 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> 
    <TITLE>TestDev</TITLE> 
</head> 
<body> 

<div class="well"> 
<p>Welcome</p> 
</div> 
</body> 
</html> 

mystyle.css

body{ 
    background-color: darkred; 
} 
.well{ 
    background: red; 
} 

回答

1

變化的風格順序包括在內。應該在Twitter Bootstrap文件後包含mystyle.css以覆蓋默認樣式。

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> 
<link rel="stylesheet" href="css/mystyle.css" type="text/css"> 
+0

所以simpel。謝謝! – Mangs

+0

歡迎,約翰! :) –