-1

Here is the code:

  body {
        background-color: blueviolet;
    }
<!DOCTYPE html>
<html>
    <head>
    <title>CSS Practice</title>
    <link href="Sheet.css" rel="Sheet">
    </head>
    <body>
        <p>
            That is a Test For You
        </p>
    </body>
</html>

But when I load the HTML I do not see the change that CSS should make, I could not find a solution for that.

8
  • 3
    rel="stylesheet" Commented Jul 3, 2021 at 17:45
  • Check if the .css is in the same directory as the .html file. If that isn't the case, try changing href="./Sheet.css" Commented Jul 3, 2021 at 17:53
  • Then the reason could be something else. But sheet is definitely not a valid value for rel. Any 404 errors on console? Commented Jul 3, 2021 at 17:54
  • And try hard refresh Commented Jul 3, 2021 at 17:55
  • I checked it, the problem was in rel part Commented Jul 3, 2021 at 18:00

2 Answers 2

3

It should be:

<link href="Sheet.css" rel="stylesheet">

A CSS document is defined with rel=”stylesheet”. Oh, and you might need to clear your cache as well.

Learn More

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

Comments

1
<link rel="stylesheet" href="style.css" >

Result

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.