2015-07-05 144 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

欢迎,约翰! :) –