CSS import etmeme rağmen çalışmıyor

html dosyası oluşturdum. CSS’i import etmeme rağmen çalışmıyor. Visual üstünde css klasörü altında style.css dosyası bulunmakta. html içine yazdığım link kodu şöyle:

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

Neden çalışmıyor olabilir?

Merhaba,

Html dosyasının içinde sadece bu paylaştığınız ifade mi yazılı? CSS dosyanın içinde ne yazılı?

HTML dosyası:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Document</title>
        <link href="css/style.css" rel="stylesheet">
    </head>
    <body>
        <h1>Bu bir heading etiketidir</h1>
        <h2>Lorem Ipsum</h2>
        <p id="p_bir">Paragraf</p>

        <div class="kutu">

        </div>
        <div class="kutu">

        </div>
    </body>
</html>

CSS dosyası:

body{
    background-color: red;
}
h1,h2{
    color: blue;
}
h2{
    background-color: chartreuse;
}


/* # işareti id seçicisi */
#p_bir{
    font-size: 28px;

}

/* . işareti class seçicisi */
.kutu{
    width: 250px;
    height: 250px;
    background-color: chartreuse;
    margin-bottom: 10px;
}

Çalışıyor görünüyor. Oluşan sayfa da aşağıda gördüğünüz gibi.

Notepad’da denedim ve çalışıyor. Visual Studio Code’da çalışmıyor. Sebebi ne olabilir sizce?

Bilmiyorum, VS Code kullanmıyorum.

1 Beğeni