Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome Developer tools -CSS file is shown empty

Thankyou for your precious time; i'm a beginner in web development and as i was trying my hands on html and css i found that the css styling isn't getting applied to the html and that the chrome developer tools shows it to be empty (the file is present but the code that i've written in css file seems to be absent) please help!

Screenshot of the problem.

index.html file

<!DOCTYPE html>
<html>
<head>
  <title>MY WEB PAGE </title>
  <link type="text/css" href="style.css"  rel="stylesheet" >
</head>
  <body>
  <h1>THIS IS MY WEB PAGE </h1>
    <p>
    css applied to this part of the code isnt being shown in the developers
    tools
    </p>
  </body>
</html> 

style.css file

body{
  background-color:black;;
}
h1{
  color:white;
  font-style: italic;
  font-family: sans-serif;
}
p{
  font-family: serif;
  color:yellow;
  font-style: oblique;
}
like image 290
kunal dubey Avatar asked Mar 16 '26 13:03

kunal dubey


1 Answers

You may be missing an angle bracket on your first line or it could be a copy-paste error. It should be: <!DOCTYPE html>

Also look in the Network tab in Chrome toolbar to make sure that it's able to find your style.css and it contains the right CSS.

Depending on how it's being hosted, you may have to hit Ctrl-F5 to tell the browser to download everything fresh instead of caching.

like image 165
Belaroth Avatar answered Mar 19 '26 06:03

Belaroth