【问题标题】:the change is not applied on index.php更改不适用于 index.php
【发布时间】: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/”文件夹中。

标签: php html css


【解决方案1】:

首先,您应该使用某种开发工具而不是刷新(因为明显的缓存问题,并且因为您在提交之前尝试设置)来尝试对 css 的更改。

此类工具的示例是用于 Chrome 的 chrome development tools 或用于 Mozilla 的 Firebug

同时,您可以尝试使用 ctrl+R 或其他一些“硬刷新”方法(取决于浏览器)进行刷新。

最后但并非最不重要的一点是,您还应该检查您是否真的设法将eltered文件上传到服务器,并且在此过程中没有发生错误。有时与服务器的 ftp 连接中断,程序无法上传文件。

【讨论】:

    猜你喜欢
    • 2013-11-09
    • 1970-01-01
    • 2013-12-14
    • 2018-10-02
    • 2017-12-20
    • 1970-01-01
    • 2013-07-12
    • 2011-02-14
    • 1970-01-01
    相关资源
    最近更新 更多