css - 为什么我不能让我的 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。
推荐阅读
- python - 为主教不工作生成对角线移动的位板
- c - 线程 1:EXC_BAD_ACCESS(代码=1,地址=0x7ffeefc00000)
- statistics - 组合2个相同分布的数组
- c# - 统一更改粒子系统开始颜色的范围
- css - 如何在 Bootstrap 中裁剪 GoogleAPI 二维码图像?
- r - ggplot 多边形 X 轴和 Y 轴缩放并更改组的颜色
- php - Codeigniter 中的 Ajax 文件上传
- java - 没有为 public com.phonepe.gandalf.models.authz.Permission 类型的参数找到注入源
- angular - 构建 Angular CLI 主题
- reactjs - 如何使用 bundle.js 文件渲染 react-router-dom 中的组件?