我的CSS没有反映在PHP页面上.我正在使用Xampp服务器. display.css文件仅在我的htdocs文件夹中.让我知道我在哪里做错了.
<?php
Php Code
?>
<html>
</head>
<link rel="stylesheet" type="text/css" src="display.css" />
<title>E-Library Display Section</title>
</head>
<center><h1>Books Available for Free Download</h1></center>
<body>
<div class="wrapper">
<div class="table">
<div class="row header">
<div class="cell"><Book Name</div>
<div class="cell">Book Description</div>
<div class="cell">Book Author</div>
<div class="cell">Book Language</div>
<div class="cell">Download Link</div>
<div class="cell">Uploader Name</div>
<div class="cell">Uploader Email</div>
</div>
<tr>
<?php
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row['bookname']."</td>";
echo "<td>".$row['bookdesc']."</td>";
echo "<td>".$row['bookauthor']."</td>";
?>
</body>
</html>
解决方法:
在样式表链接中,将src更改为href.
<link rel="stylesheet" type="text/css" href="display.css" />
另外,您有两个关闭的< / head>标签,并且没有打开的标签,但这不会引起您的问题.