0

my code is not linking with my css

<!DOCTYPE html>
<html>
<head>
    <link href="main.css" rel="slylesheet" text="text/css">
<title></title>
</head>
<body>
    <header>
        <div class="container">
            <img src="beens.jpg" alt="logo" class="logo">
            <nav>
                <ul>
                    <li><a href="#">about</a></li>
                    <li><a href="#">games</a></li>
                    <li><a href="#">contact</a></li>
                    <li><a href="#">blog</a></li>
                </ul>
            </nav>
        </div>
        
    </header>
</body>
</html>

it worked on my flash drive but not localy

.container {
    width: 80%;
    margin: 0 auto;
}
.header {
    background: rgb(51, 146, 153);
}
li {
  color: rgb(142, 15, 15);
}

my background is still white plz help

i tryed rewriting my link code and checking here

1
  • can you provide a screenshot of your dir structure for this project?
    – Shahed
    Nov 21, 2022 at 7:20

4 Answers 4

4

You have a typo here: <link href="main.css" rel="slylesheet" text="text/css">

It is supposed to be stylesheet

Also you are calling your header as a class .header But since you didnt give it a class and want to call the tag you need to set it to

header {
    background: rgb(51, 146, 153);
}
0

try like this,

.container {
    width: 80%;
    margin: 0 auto;
}
header {
    background: rgb(51, 146, 153);
}
li {
  color: rgb(142, 15, 15);
}
<!DOCTYPE html>
<html>
<head>
    <link href="main.css" rel="slylesheet" text="text/css">
<title></title>
</head>
<body>
    <header>
        <div class="container">
            <img src="beens.jpg" alt="logo" class="logo">
            <nav>
                <ul>
                    <li><a href="#">about</a></li>
                    <li><a href="#">games</a></li>
                    <li><a href="#">contact</a></li>
                    <li><a href="#">blog</a></li>
                </ul>
            </nav>
        </div>
        
    </header>
</body>
</html>
 

0

You can try this c

If it doesnt work then the problem is the code below the

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 24, 2022 at 5:07
-2

That's standard code:

li a {
  color: RGB(142, 15, 15);}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.