當我將所有樣式放在樣式標籤中時它工作正常,但如果我將這些代碼放在外部樣式表中,它不會在前端顯示任何樣式。外部樣式表不顯示任何樣式,但內部樣式不會顯示任何樣式
<!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><?php $title; ?></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<table border="1" cellpadding="2" cellspacing="2">
<tr>
<th>post ID</th>
<th>post title</th>
<th>post Description</th>
<th>Author</th>
<th>Date</th>
</tr>
<?php
foreach($posts as $post)
{
echo "
<tr>
<td>".$post->Post_id."</td>
<td>".$post->post_title."</td>
<td>".$post->Post_description."</td>
<td>".$post->author."</td>
<td>".$post->date."</td>
</tr>
" ;
}
?>
</table>
<body>
</body>
</html>
和我的外部樣式表是 /* CSS文件*/
table{
width:1000px;
text-align:center;
margin:auto;
}
th{
background:#0CC;
animation-direction:normal;
height:50px;
}
td{
height:50px;
background:#396;
color:#FFF;
}
我DONOT明白什麼是錯的。
你可以試試這個在PHP? 'if(file_exists(「css/style.css」))echo「是」;'也許這是錯誤的路徑?爲了清楚起見,我希望在
和之間 – Andreas爲什麼你會在頭部和身體之間張貼一張桌子?它在之後和
之前。你確定這是正確的嗎? – Andreas@DSaha任何運氣與答案? – Andreas