我有这个 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>
这些包括文件。
标题.php
<div id="header">
<img src="banner.jpg">
</div>
侧边栏.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;
}
侧边栏链接设置正常。但是,我更改了一些边距和边框,以便我可以检查它是否正常工作,并且它不工作。我刷新了网站,但没有新内容出现。
你能帮我弄清楚为什么会这样吗?
最佳答案
首先,您应该尝试 css 中的更改,使用某种开发工具,而不是刷新(对于明显的缓存问题,并且因为您在提交之前尝试设置)。
此类工具的示例是 chrome development tools适用于 Chrome 或 Firebug用于 Mozilla。
同时,您可以尝试使用 ctrl+R 或其他一些“硬刷新”方法(取决于浏览器)进行刷新。
最后但并非最不重要的一点是,您还应该检查您是否真的设法将更改的文件上传到服务器,并且在此过程中没有发生任何错误。有时与服务器的 ftp 连接中断,程序无法上传文件。
关于php - 更改未应用于 index.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24147018/