背景图片:url('img / bg-showcase-2.jpg');

我已经为WordPress尝试了一些代码,但是没有用。请分享有关不使用这些代码的任何想法。

background-image: url('<?php bloginfo('template_directory'); ?>/img/bg-showcase-2.jpg');  

background-image: url('<?php bloginfo('template_url'); ?>/img/bg-showcase-2.jpg');
g109007 回答:背景图片:url('img / bg-showcase-2.jpg');

应该是

background-image: url('img/bg-showcase-2.jpg');
,

background-image需要设置widthheight属性。

示例:

div {
background-image:url('/img/bg-show-case-2.jpg');
width:300px;
height:300px;
}
本文链接:https://www.f2er.com/2980839.html

大家都在问