无法让外部样式表工作

时间:2016-11-15 03:36:33

标签: html css stylesheet

嘿伙计们我已经知道这很容易,但我已经尝试了所有我能想到的东西并且无法弄明白。我无法让我的样式表在我的html上工作,两者都保存在文件夹website1中。里面有2个文件夹css和index,文件保存在相应的文件夹中。不介意我的编码,这些不是我的网站只是我发送帮助的一个非常小的例子。

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">

</head>
<body>
<div class="container">
`<div class="row">
<div class="col-xs-6">
    <button class="btn btn-default btn-xl">About</button>
    <button class="btn btn-default btn-xl">Portfolio</button>
    <button class="btn btn-default btn-xl">Contact</button></button>



    </a>
    </div>
</div>
</div>


</body>
</html>

我的css页面看起来像这样

body{
color: blue;
}

button{
color: aliceblue;
}

1 个答案:

答案 0 :(得分:1)

如果你的html文件在index子文件夹中,并且css在css子文件夹中,那么你应该像:

<link rel="stylesheet" type="text/css" href="../css/style.css">

希望这会有所帮助:)