【发布时间】:2014-06-19 15:15:30
【问题描述】:
我是 WordPress n00b。我似乎无法将简单的 CSS 导入我的页面。
这是我尝试过的:
index.php
<link href="style.css" rel="stylesheet" type="text/css">
style.css
/* External */
@import: url('http://fonts.googleapis.com/css?family=Varela');
@import: url('https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');
/* Internal */
@import: url('css/bootstrap.css');
@import: url('css/custom-styles.css');
我也试过了:
index.php:
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css">
这只是为了确定:
<link href="<?php bloginfo('style.css'); ?>" rel="stylesheet" type="text/css">
我已经完成了研究,但除了我上面尝试过的之外我找不到任何东西。因此,如果这是重复,我深表歉意。
编辑:
这在 index.php 中的 WordPress 中不起作用:
<link href="style.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Varela" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link href="css/custom-styles.css" rel="stylesheet" type="text/css">
【问题讨论】:
-
我回滚了您的修订,因为您从问题中删除了问题代码。为了使下面的答案有意义,您的问题中必须使用冒号。
-
你确定那些文件路径是正确的吗?
-
@David 我很确定。我从工作静态 html 站点更改的唯一内容是添加到 style.css 的链接并将文件扩展名从 .html 更改为 .php