2

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:

Files in the /css directory

The htdocs folder I have this:

htdocs folder where the css folder is located

1 Answer 1

1

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"/>
Sign up to request clarification or add additional context in comments.

2 Comments

Actually you are using the wrong codes to link external css files.
It would be better to explain what is wrong about the wrong lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.