喔!2.5 和语义网格



我希望你周末愉快。

我有一个问题要问你。

我使用joomla!2.5和语义网格(使用较少)。

在我的标题中,我调用类似 SG 示例中的内容:

<link media="screen" type="text/less" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/css/styles.less" rel="stylesheet">
// my less file
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/js/less-1.1.3.min.js">
// the js less compiler I think

当我查看Firebug中的网络面板时,有404个CSS文件。但这是他们第二次加载。看。

GET /joomla/ 200 OK
GET fixed.less 304 Not Modified
GET less-1.1.3.min.js 304 Not Modified
GET reset.css 304 Not Modified
GET demo.css 304 Not Modified
GET grid.less 200 OK
GET fixed.less 304 Not Modified
GET grid.less 304 Not Modified
GET reset.css 404 Not Found // http://localhost/joomla/stylesheets/reset.css
GET demo.css 404 Not Found // http://localhost/joomla/stylesheets/demo.css

它重新加载了我的@import,但文件路径错误。

http://localhost/joomla/stylesheets/demo.css 

而不是

http://localhost/joomla/templates/myTpl/css/stylesheets/demo.css

因此,样式不会显示。

在我的styles.less中,我以这种方式进行导入:@import 'stylesheets/demo.css';

是什么导致了这个问题,我该如何避免它?

感谢您的帮助

我认为

这是因为您没有从正确的位置调用文件

尝试使用@import '../stylesheets/demo.css';

附带说明一下,您忘记在 PHP 标签中添加分号,如下所示:

<link media="screen" type="text/less" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/styles.less" rel="stylesheet">
<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/less-1.1.3.min.js">

最新更新