如何让我的PHP包含在底部?

时间:2015-09-16 22:39:02

标签: php html css

所以我一直在编辑我的网站,并且最近尝试上传基础知识(索引,css和其他一些页面),但是当我查看其中一个页面时,实际文章与底层div重叠,我不知道#39;不知道它是如何完成的。

这是底部的CSS:

div#bottom {
    background-color: #2C292B;
    width: 100%;
    height: 120px;
    color: #888888;
    padding-top: 40px;
    padding-bottom: 40px;
}

div#copyright {
    background-color: #1F1D1E;
    width: 100%;
    height: 45px;
    font-weight: bold;
}

以下是索引的代码:

<script type="text/javascript">
        if (location.pathname.substr(0, 3) !== "/m/" && screen.width <= 720) {
        location.href = "/m" + location.pathname;
}
</script>
<a name="top"></a>
<!doctype html>
<html>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en-gb">
<head>
    <title>michae|dylanEdwards - artistic blog</title>

    <link rel="icon" href="favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link href = "_includes/style.css" rel="stylesheet" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="_includes/style.css" />
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="_includes/slider/style.css" />

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta property="og:image" content="http://www.michaeldylanedwards.co.uk/admin/uploads/op-image.png"/>
    <meta property="og:description" content="michae|dylanEdwards is a contemporary British Art and Design Student at Liverpool John Moores University. In which creates works in which provide a sociological question in regards to how society sees itself. Also by means of design."/>
    <meta name="description" content="michae|dylanEdwards is a contemporary British Art and Design Student at Liverpool John Moores University. In which creates works in which provide a sociological question in regards to how society sees itself. Also by means of design.">
    <meta name="keywords" content="art blog mickword michaeldylanedwards michae|dylanEdwards michael dylan edwards liverpool john moores university sociological history"/>

<script>var SITE_URL = 'http://wowslider.com/';</script>
<script type="text/javascript" src="_includes/slider/jquery.js"></script>
<script type="text/javascript" src="_includes/slider/a.js"></script>
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25854704-1']);
_gaq.push(['_setDomainName', '.wowslider.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowHash', false]);
if(document.cookie.match("(^|;\\s)__utma") && !/utmcsr=\(direct\)/.test(unescape(document.cookie))) {
    _gaq.push(
      ['_setReferrerOverride', ''],
      ['_setCampNameKey', 'aaan'], 
      ['_setCampMediumKey', 'aaam'], 
      ['_setCampSourceKey', 'aaas'], 
      ['_setCampTermKey', 'aaat'], 
      ['_setCampContentKey', 'aaac'], 
      ['_setCampCIdKey', 'aaaci']
    )
}

_gaq.push(['_trackPageview']);  

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
</head>

<body>
    <center>
        <?php include("_includes/header.html"); ?>
        <div id="frontad">
            <div id="wowslider-container1">
                <div class="ws_images">
                    <ul>
                        <li>
                            <a href="link">
                                <img src="_includes/slider/adverts/1.png" alt="" title="News Title Number #1" id="wows1_0"/>
                            </a>
                            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
                        </li>
                        <li>
                            <a href="link">
                                <img src="_includes/slider/adverts/2.png" alt="" title="News Title Number #2" id="wows1_1" />
                            </a>
                            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
                        </li>
                        <li>
                            <a href="link">
                                <img src="_includes/slider/adverts/3.png" alt="" title="News Title Number #3" id="wows1_2"/>
                            </a>
                            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
                        </li>
                        <li>
                            <a href="link">
                                <img src="_includes/slider/adverts/4.png" alt="" title="News Title Number #4" id="wows1_3"/>
                            </a>
                            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
                        </li>
                    </ul>
                </div>
            </div>
            <script type="text/javascript" src="_includes/slider/wowslider.js"></script>
            <script type="text/javascript" src="_includes/slider/script.js"></script>
        </div>
        <div id="themespacer"></div>
        <div id="frontnews">
            <div id="newsleft">
                <?PHP
                    $category = "6";
                    $template = "New_homepage";
                    $number = "3";
                    include("admin/show_news.php");
                ?>       
            </div>
            <div id="newsright">
                Google Adsense Here
            </div>
        </div>
        <?php include("_includes/bottom.html"); ?>
    </center>
</body>
</html>

这是网页本身:

http://www.michaeldylanedwards.co.uk/archives.php?id=1397654579

当我希望它看起来像这样:

http://www.michaeldylanedwards.co.uk/

任何帮助都会很棒!

编辑:这也是bottom.html!

<div id="themespacer"></div>
        <div id="bottom">
            <div id="bottomcontent">
                <div id="bottomleft">
                    <div id="bottomheader1">
                        SITE LINKS.
                    </div>
                    <img src="_img/spacer.png" width="0" height="25"/>
                    <a href="index.php">Homepage</a>
                  <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                    <a href="blog.php">Blog</a>
                    <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                    <a href="blog.php?id=1436143282">About Us</a>
                  <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                    <a href="blog.php?id=1436145183">Contact</a>
                    <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                    <a href="blog.php?id=1436140662">Privacy Policy</a>
              </div>
                <div id="bottomcenter">
                    <div id="bottomheader1">
                        EXTERNAL LINKS.
                    </div>
                    <img src="_img/spacer.png" width="0" height="25"/>
                    <a href="http://www.facebook.com/mickeeART" target="_blank">Facebook</a>
                  <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                  <a href="http://www.twitter.com/mickeeART" target="_blank">Twitter</a>
                    <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                  <a href="http://michaeldylanedwards.tumblr.com" target="_blank">Tumblr</a>
                    <br>
                    <img src="_img/spacer.png" width="0" height="15"/>
                  <a href="http://www.instagram.com/mickeehh" target="_blank">Instagram</a>
                    <br>
                    <img src="_img/spacer.png" width="0" height="15" />
                  <a href="http://www.ljmu.ac.uk" target="_blank">Liverpool John Moores University</a>
              </div>
                <div id="bottomright">
                    <div id="bottomheader2">
                        Sign up for the newsletter!
                    </div>
                    <br>
                    Coming Soon...
              </div>
            </div>
        </div>
        <div id="copyright">
          <div id="copyrightcontent">
            <div id="copyrightleft">
                    COPYRIGHT © 2015 MICHAELDYLANEDWARDS.CO.UK
            </div>
                <div id="copyrightright">
                    <a href="#top">
                        TOP OF PAGE
                    </a>
                </div>
          </div>
        </div>

1 个答案:

答案 0 :(得分:2)

由于您悬浮了div#newsleftdiv#newsright元素并且它们具有固定的高度,因此您需要clear,因为您的底部导航在其下方浮动。

最重要的是,div#newsleft上CSS中240px的固定高度导致该div仅为240px高,因此其中的内容溢出导航。

我将<div style="clear: both">&nbsp;</div>放在#newsright的结束div之后,删除了height: 240px的{​​{1}}属性,并且显示正确。

小提琴here