3

WAMP 服务器加载 index.html 很好,但不加载任何额外的 css 样式表和脚本文件。

我试过这些

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

编辑

我当前的 index.html 页面是

<!DOCTYPE HTML>
<html lang='en'>
<head>

<title>Electronic Components</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/style.css">

</head>
<body>
<h2>Lorem Ipsum</h2>


</body>
</html>

编辑2个CSS

h2 {

color: orange;
font-style: italic;

 }
4

5 回答 5

4

刷新浏览器缓存。按“Ctrl+F5”就可以了。

于 2016-11-25T20:35:49.953 回答
0

这对我有用:

<link rel="stylesheet" href=".\style.css">
于 2021-09-17T11:05:33.103 回答
-1

我有同样的问题,对我有用的是这个

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

享受

于 2018-04-06T11:49:22.907 回答
-1

You forgot to use type

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

Also note

 <link ....>  // this is right
 <link ..../> // avoid this

Your HTML file seems right , try making this small css file in css folder and link to it

body{background-color:blue;}

Test this

于 2015-09-06T18:37:55.203 回答
-1

从 url 栏中选择完整的 url,然后按 ENTER 键......它的工作原理!;)

于 2019-03-09T13:18:31.977 回答