简体   繁体   English

链接外部 css 文件不起作用

[英]Linking an external css file doesn't work

I'm trying to link my local bootstrap, and style file to my html file, but none of them works.我试图将我的本地引导程序和样式文件链接到我的 html 文件,但它们都不起作用。

Here's my html file:这是我的 html 文件:

<!DOCTYPE html>
<html>
    <head>
        <title>Test page</title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link type="text/css" ref="stylesheet" href="css/bootstrap.css">
        <link type="text/css" ref="stylesheet" href="css/styles.css">

    </head>
    <body>
        <script src="js/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>

        <div class="navbar-header">
            <div class="navbar navbar-inverse navbar-static-tops">

            </div>
        </div>
    </body> 
</html>

My css files are located in a folder called css.我的 css 文件位于名为 css 的文件夹中。
I got these files there:我在那里得到了这些文件:

/css 目录下的文件

The htdocs folder I have this: htdocs 文件夹我有这个:

css文件夹所在的htdocs文件夹

JUST TRY THIS ---试试这个---

<!DOCTYPE html>
<html>
    <head>
        <title>Test page</title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/styles.css"/>
    </head>
    <body>
        <script src="js/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>

        <div class="navbar-header">
            <div class="navbar navbar-inverse navbar-static-tops">

            </div>
        </div>
    </body> 
</html>

These Codes are Wrong ---这些代码是错误的---

 <link type="text/css" ref="stylesheet" href="css/bootstrap.css">
        <link type="text/css" ref="stylesheet" href="css/styles.css">

These are Correct ---这些是正确的---

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM