Bootstrap无法与Sass配合使用

时间:2018-07-30 16:46:49

标签: html css sass

在这种情况下,Sass正常工作。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="style.css">

</head>
<body>

<h1>This is a title</h1>

</body>
</html>


Sass Project.

 $primary-color:red;

h1{
  color:$primary-color;
}

但是当我放置自举程序或离子子的链接时,Sass停止工作。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

</head>
<body>

<h1>This is a title</h1>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

正如Sunny Patel在评论中所解释的,您应该将bootstrap.min.css 放在其他CSS之前

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="style.css">