<链接 rel= "stylesheet" 类型= "text/css" href= "../styles.css" >不起作用



这是目录屏幕截图1这是目录屏幕截图2我正在尝试将Twitter克隆作为我的第一个PHP项目。但是我面临这个问题;浏览器无法找到CSS文件。这是代码:

/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
}
body {
  margin-bottom: 60px; /* Margin bottom by footer height */
}
footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px; /* Set the fixed height of the footer here */
  line-height: 60px; /* Vertically center the text there */
  background-color: #f5f5f5;
}
.container {
  width: auto;
  max-width: 680px;
  padding: 0 15px;
}
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../styles.css">
    <title>Twitter</title>
</head>

style.css位于当前文件夹的文件夹中。帮我!

如果您使用文档相对链接,则要求头痛。我总是使我的链接root相对

/css/styles.css

或您相对于root的任何路径而不是

../styles.css

由于事物被移动并记录了相对链接,我在职业生涯中遇到了很多错误。

最新更新