php - 更改未应用于 index.php

标签 php html css

我有这个 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/

相关文章:

javascript - 使用 ajax 使用来自 php 页面的数据填充引导模式

php - 允许用户 Tomcat7 将文件发送到 apache2 文件夹 (httpdocs)

javascript - 在 javascript 中发送 FormData 中的 FileList

html - 如何拉伸(stretch) SVG 图像?

javascript - 将 float 的 div 粘贴到另一个元素的当前位置

jquery - 手动调整大小和拖动 bootstrap 3 modals

php - 使用 Curl 或其他方式检索完全呈现的页面?

html - 删除生成的 Javadoc 中的注释 "Generated by Javadoc on <date> <time>"

html - 填充不起作用时如何填充空格

html - 当我在平板电脑上打开时,如何防止我的 Logo 重叠到我的主菜单栏上