![
<div id = "headz">
<div class = "titlez">
<h1>Developing Software by Delacrank</h1>
</div>
</div>
][屏幕截图 PhP 及之后]
.titlez {
font-family: fantasy;
font-size: xx-large;
color: darkgreen;
background-color: lightcyan;
}
#headz{
text-align: center;
margin-left: -2em;
margin-right: -2em;
padding-bottom: 1em;
padding-top: 1em;
background-color: black;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Our first Website (Lists, Definitions and Tables)</title>
<link rel="stylesheet"
type = "text/css"
href="testcss.css">
</head>
<body>
<?php include('/Applications/XAMPP/xamppfiles/htdocs/includes/header.php'); ?>
最近我决定开始使用 php 来组织我的由 html 文件组成的网站。目前,我正在使用 apache 服务器附带的 xampp。我向我的服务器添加了一个 .htaccess 文件('AddHandler application/x-httpd-php .htm .html'),以便它可以使用我的 html 文件中的 php 脚本。
一切似乎都很好,问题是当我从我的包含文件夹添加文件时,链接到 html 页面的 css 样式工作正常,除了字体。 . .我没有使用任何特殊字体,唯一显示的字体默认是courier,不会显示fantasy、times、arial等。
我是不是遗漏了什么,请帮忙。
我将 css 文件添加到 htdocs 文件夹中,它显然位于它的位置,因为其他样式工作正常。包含文件位于/applications/xampp/xamppfiles/htdocs/includes/。
我添加了代码的屏幕截图,上面是包含 php,下面是没有 php 的相同代码。一切都一样,唯一的区别是字体大小以及字体系列和字体颜色,所以字体没有任何变化。
最佳答案
我解决了这个问题。原来这是很简单的事情,我在不需要添加的时候添加了
标签。嗯。
关于php - 字体不会显示在 php include 的标题中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28968255/