Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS外部文件不';不起作用_Html_Css - Fatal编程技术网

Html CSS外部文件不';不起作用

Html CSS外部文件不';不起作用,html,css,Html,Css,我是CSS新手,所以我会练习它。 我编写了一个css文件和一个html文件,以便在我的html页面上看到外部css文件的效果,但没有观察到任何变化 这是我的密码 style.css p { Color:red; } index.html <!DOCTYPE html> <html> <head> <meta charset ="UTF-8"> <title>Css

我是CSS新手,所以我会练习它。 我编写了一个css文件和一个html文件,以便在我的html页面上看到外部css文件的效果,但没有观察到任何变化

这是我的密码

style.css

p {
  Color:red;    
} 
index.html

  <!DOCTYPE html>
    <html> 
      <head>
        <meta charset ="UTF-8">
        <title>Css Syntax </title>
        <link rel ="stylesheet" href="style.css" type="text/CSS">
      </head>
      <body> 
        <p>this is nirmal paragtne</p>
      </body>
    </html>

Css语法
这是尼马尔·帕拉特纳


您的代码对我来说似乎运行良好。。如果它在同一个目录中,如果没有键入错误,您可以尝试检查您的文件名?

我在firefox浏览器中检查了我的代码,它工作正常

我无法使用该代码重现您的问题。最有可能的解释是你的URL搞错了。我和@Quentin得出了相同的结论。您的
href
可能没有链接到正确的路径。
index.html
style.css
是否在同一目录中?@Tesseract yes在一个目录中让我换一句话,这两个文件在该目录中处于同一级别?