【发布时间】:2012-04-11 19:31:26
【问题描述】:
我在 codeigniter 中添加了一个样式表:
<head>
<meta charset="utf-8">
<title>Site Administrator</title>
<link rel="stylesheet" href="../../css/administrator.css" type="text/css" ></link>
</head>
但是没有添加规则。我去两个目录上去css..href的方向是对的..我在netbeans中使用了自动完成功能..但是为什么页面没有添加规则?是codeigniters的问题吗?
我在样式表中的规则:
#container
{
margin: 0px auto;
width:50%;
background-color: #99BC99;
}
#container:first-child
{
text-align: center;
}
#heading
{
text-align: right;
}
h2
{
float:right;
margin-right: 130px;
}
a
{
text-decoration: none;
}
我的html:
<div id="container">
<h1>ממשק מנהל</h1>
<div id="heading">
<h2>
<?php echo anchor('news/local/123', 'צור נושא', 'title="News title"'); ?>
</h2>
<h2>
<?php echo anchor('news/local/123', 'הוסף אמייל', 'title="News title"'); ?>
</h2>
<h2>
<?php echo anchor('news/local/123', 'שנה שם וסיסמה', 'title="News title"'); ?>
</h2>
</div>
更新:
这就是它给我的:
This is what it gives me: <link rel="stylesheet" href="http://localhost/finance_site/index.php/css/administrator.css" />
无论何时,我都会这样做:
<link rel="stylesheet" href="<?=site_url('css/administrator.css');?>" />
好的,我知道了,是这样的:
<link rel="stylesheet" href="http://localhost/finance_site/css/administrator.css" />
有没有办法重写它,使其成为代码点火器的相对链接......或者至少更便携?
【问题讨论】:
-
您提供的信息太有限
-
你想要多少信息?
-
您使用的文件夹结构是什么? CodeIgniter 和 CSS 放在哪里?
标签: css codeigniter directory-structure