【发布时间】:2016-06-16 17:48:12
【问题描述】:
我有这个样式代码来显示背景图像。我尝试 trim() 和 urlencode() 删除空格,但没有奏效。
$get_active_quiz = mysql_query("SELECT * FROM questions WHERE status ='active' AND title = '$title'");
$row_active_quiz = mysql_fetch_array($get_active_quiz);
$background_image = $row_active_quiz['cover_image'];
<body style="
background-image: url(<?php echo $background_image ?>);
background-size:100% auto;
background-repeat: no-repeat;">
【问题讨论】:
-
没有工作是什么意思?,你得到错误了吗?,你得到输出但url是空的?,还是什么?
-
@Neat 没有得到输出
-
将你的body标签写成:- echo " ";
标签: php css image background-image