我有一个问题 - 我正在尝试使用 CSS 为图层添加背景图像,但它不起作用... CSS 文件看起来像这样
header {
background-image: url("boisko.jpg");
background-repeat: no-repeat;
background-size: 100%;
background-position: center;
}
主文件是这样的
<?php
error_reporting(0);
echo "<style>";
include "styl.css";
echo "</style>";
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<td width=\"100%\" colspan=\"2\">";
include_once"Naglowek/index.php";
echo"<td>
</tr>
<td width=\"100%\" colspan=\"2\">";
include_once"Jezyk/index.php";
echo"</td>
</tr>
</table>";
?>
背景图像应该显示在包含“Naglowek.index.php”的单元格中,但它没有...该文件如下所示:
<?php echo "<head><br><h1>Cracow Sunday Football League</h1><br><br></head>";?>
我知道我可以用 html 编写该文件,但如果它真的无关紧要,我更希望它保留在 php 中。
为什么我的背景图片不显示?
最佳答案
你在 CSS 中有 header
,但在 HTML 中有 head
关于PHP 文件不显示来自 CSS 文件的背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37992276/