我使用LESS来组织和导入我所有的CSS文件。我也使用了我的style.less中集成的Twitter Bootstrap。它可以像下面一样正常工作,但是当我使用lessc来缩小文件并将其压缩到一个地狱时,我的twitter引导程序css会崩溃。原因是我的bootstrap.min.css
与图像的相对路径为"../img"
,所以当我缩小所有这些文件并转储我的输出文件时,它不再找到此路径。LESS导入CSS和相对路径
究竟应该如何解决这个问题,我不想在我的CSS中硬编码绝对URL?
style.less
@import './folder_one/file_one';
@import './folder_one/file_two';
@import './folder_two/file_one';
@import './folder_three/file_one';
// this bootstrap css references images relatively ../img/
@import './bootstrap/bootstrap.min.css';
我推荐你使用'.htaccess'。 –