用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2246|回复: 4
收起左侧

[版本 2.x] 路径中去除index.php后外联样式不起作用?

[复制链接]
发表于 2012-11-2 08:49:50 | 显示全部楼层 |阅读模式
本帖最后由 lyszpaj 于 2012-11-2 09:48 编辑

问题是这样的,本来外联样式表是起作用的:
在head区<base href="<?=base_url()?>"/>
<link rel="stylesheet" type="text/css" href="style/new.css"> //style文件夹在根目录下
我在.htaccess文件中设置将index.php去除后其他都ok,就是样式不起作用了,求帮助!
 楼主| 发表于 2012-11-2 09:36:22 | 显示全部楼层
发表于 2012-11-2 11:18:17 | 显示全部楼层
访问CSS文件是否会提示403错误?
是的话请尝试更改.htaccess文件中的重写规则
 楼主| 发表于 2012-11-2 13:46:48 | 显示全部楼层
没有错误,页面都能打开,数据库调用也成功,就是样式不起作用。晕死!
附上页面html代码:<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base />
<title>Ci_新闻发布系统</title>
<link rel="stylesheet" type="text/css" href="style/new.css">
</head>

 楼主| 发表于 2012-11-2 13:54:18 | 显示全部楼层
ok了!在RewriteCond $1 !^(index\.php|images|style|robots\.txt)   中加上sytle

本版积分规则