0
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <link rel="css" type="text/css" href="stylesheet.css"/>
    </head>
    <body>
        <p>
            <strong>C</strong>ascading
            <strong>S</strong>tyle
            <strong>S</strong>heets
        </p>
    </body>
</html>


p {
    color: blue;
    text-decoration: underline;
    }
strong {
    color:red;
    }
body {
    background: aqua;
    }

For some reason this won't load. I ran it through CSS and HTML validators, but I use developer tools and it shows no css stylesheets attached, and my (very basic) formatting is not being applied. I looked at a few other questions and nothing fixed this.

4 Answers 4

5

Try rel="stylesheet" instead of rel="css"

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

And if your file path is correct then it must load css, simple as that

Sign up to request clarification or add additional context in comments.

Comments

4

Try with this format

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

Read more at http://www.w3schools.com/tags/att_link_rel.asp

Comments

3

Let me if it works

HTML DOC

<!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="UTF-8"/>
           //Change rel to stylesheet and it done
            <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
        </head>
        <body>
            <p>
                <strong>C</strong>ascading
                <strong>S</strong>tyle
                <strong>S</strong>heets
            </p>
        </body>
    </html>

Stylesheet.css

  p {
        color: blue;
        text-decoration: underline;
        }
    strong {
        color:red;
        }
    body {
        background: aqua;
        }

Comments

2

Here is an example:

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

To load external css you must include a reference to the css file inside the link tag

Check live demo

Comments

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.