为什么我不能让我的 css 在 mamp 中呈现?

问题描述

我已经使用 Mamp 在我的 mac 上本地设置了 wordpress,但 css 文件不起作用。我可以正确获取 CSS 文件链接,并且在 Chrome 和 Safari 中检查代码时,它会显示正确的 CSS 文件。但是无论我写什么类型的 CSS 代码,它都不会显示在我的页面上。

这是我的 header.PHP 文件

<html>
<head>
    <Meta charset="utf-8"/>
    <link rel=”stylesheet” href="<?PHP bloginfo('stylesheet_url'); ?>" type=”text/css” media=”screen” />
    <title>My first website</title>
</head>
<body>

这是我要渲染的 CSS:

* {
    margin: 0;
    padding: 0;
}

#wrapper {
    font-family: 'Trebuchet MS','Lucida Sans Unicode','Lucida Grande','Lucida Sans',Arial,sans-serif;
}

所以当它在浏览器中显示代码时,它看起来像这样

<html>
<head>
    <Meta charset="utf-8"/>
    <link rel=”stylesheet” href="http://localhost/firstsite/wp-content/themes/newtheme/style.css" type=”text/css” media=”screen” />
    <title>My first website</title>
</head> ```

I can even click the CSS file from the inspected code and will then see the right file. What am I doing wrong here? PS. I have tried hard refresh of Chrome.

解决方法

解决方案是@gtamborero 建议的错误使用引号。谢谢你。现在浏览器正在完美地读取 CSS。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...