我有一个像这样的样式表链接
<link href="css/<? echo $theme;?>/styles.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)
在CSS内部,我希望能够回显db输出的背景图像
body{ background-image:url(../../images/<?php echo $theme.'/'.$background;?>);}
Run Code Online (Sandbox Code Playgroud)
我尝试将以下内容添加到页面的开头,但它只是输出html代码中的所有内容
<? header ("Content-type: text/css");?>
Run Code Online (Sandbox Code Playgroud)
我相信这有一点,有人可以建议最好的行动方案吗?
提前致谢
在使用WordPress时,是否可以像在CSS中一样使用CSS获取背景图像.我试过这样做,但它不起作用.
background-image: url("<?php bloginfo('template_directory'); ?>/images/parallax_image.jpg ");
Run Code Online (Sandbox Code Playgroud)