简体   繁体   中英

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.

Here's my html file:

<!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.
I got these files there:

/css 目录下的文件

The htdocs folder I have this:

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"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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