【发布时间】:2018-09-17 18:33:24
【问题描述】:
代码:
style="background-image: url(wp-content/uploads/2018/03/example.jpg);"
这样做时图像是可见的,但这就是我问这个问题的全部原因。
style="background-image: url(http://foo.com/wp-content/uploads/2018/03/example.jpg);"
wp-content 是路径中的第一个文件夹。
我试过了:
style="background-image: url('wp-content/uploads/2018/03/example.jpg');"
style="background-image: url(/wp-content/uploads/2018/03/example.jpg);"
style="background-image: url('../wp-content/uploads/2018/03/example.jpg');"
那么问题来了,为什么路径正确时图像不显示?
解决方案实施:
style="background-image: url(insert_your_localhost/wp-content/uploads/2018/03/example.jpg);"
【问题讨论】:
标签: html css wordpress path background