PHP 文件不显示来自 CSS 文件的背景图像

标签 php html css

我有一个问题 - 我正在尝试使用 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/

相关文章:

php - 编辑表的特定字段

php - 如何使用流畅的接口(interface)对所有数据成员变量调用相同的方法

javascript - ASP.NET MVC、IE 11、$(document).ready 和返回导航缓存

html - CSS 阻止在某一点调整大小?

python - 错误 404 - 使样式表在 Bottle 中工作(Python Web 框架)

html - 我怎样才能只加载合适的 HTML 视频?

html - div 中的图像影响表格中的行

php - MySQL Select Query 全局使用(多个PHP页面)

javascript - 类型错误 : Cannot read property 'style' of null in React App

php - 测试 Controller 时忽略 Laravel 5.1 mock 期望