【发布时间】:2014-06-11 01:21:38
【问题描述】:
我有这个 index.php 文件
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<?php include('includes/header.php');?>
<?php include('includes/sidebar.php');?>
<?php include('includes/content.php');?>
<?php include('includes/footer.php');?>
</body>
</html>
这些包括文件。
header.php
<div id="header">
<img src="banner.jpg">
</div>
sidebar.php
<div id="sidebar">
<a href="index.php" class="sidebar">Home</a><br />
<a href="study.php" class="sidebar">Study</a><br />
<a href="calendar.php" class="sidebar">Calendar</a><br />
<a href="diary.php" class="sidebar">Diary</a>
</div>
页脚.php
<div id="footer">
<p>haha</p>
</div>
我有这个 css 文件。
#container{
margin:0px 0px 0px 0px;
width:1024px;
border:3px;
}
#header{
margin-left:50px;
border:3px;
}
#sidebar{
margin-left:30px;
float:left;
width:300px;
height:900px;
border:3px;
}
#sidebar a:link{
color : #ff6c00;
text-decoration : none;
}
#sidebar a:visited{
color : #ff6c00;
text-decoration : none;
}
#sidebar a:hover{
color : #00991d;
text-decoration : underline;
}
#content{
margin-left:30px;
float:left;
width:724px;
height:900px;
border:3px;
}
#footer{
border:3px;
text-align:center;
clear:both;
width:1024px;
}
侧边栏上的链接设置正常。但是,我更改了一些边距和边框,以便我可以检查它是否工作,它不工作。我刷新了网站,没有出现任何新内容。
你能帮我弄清楚为什么会这样吗?
【问题讨论】:
-
您是否尝试过硬刷新(Windows 上是 Ctrl+F5,Mac 上是 Command + R)?
-
您是否尝试清除浏览器缓存?
-
确保 css 文件在根目录下,而不是在任何“css/”文件夹中。