我的风景:我安装了 Omega 主题的 Drupal 7。
我的问题:我必须为我的 css 的特定区域(section-header)设置一个随机背景。由于响应式设计,我有 4 个单独的 css 文件,文件名相同,但唯一的区别是 _mobile _narrow _normal _wide 后缀。我用一些简单的行在css文件中设置了背景:
#section-header {
background: url(../images/sf_header_wide.jpg) no-repeat top center;
height: 390px;
margin: 0;
padding: 0;
}
我需要为背景添加多个图像,我想知道是否可以从外部源(例如我的模板 php 文件)导入文件名并在不添加背景行的情况下获得类似的内容template.php 文件,因为我为响应式设计分离了 css 文件
#section-header {
background: url("../images/<?php echo $fileimage; ?>_wide") no-repeat;
height: 390px;
margin: 0;
padding: 0;
}
是否有可能获得我需要的东西?