html - IFrame 问题 : Footer is on top of iframe

标签 html css iframe footer

我知道这可能正对着我,但我不能完全确定是什么导致了我的问题。我有一个页脚和一个 iframe 不能一起玩。我的页脚位于我的 iframe 之上。我需要我的页脚位于我页面的底部,就像我所有其他页面一样,并留在那里,无论用户是否上下滚动。只需要它留在底部。我不太确定它是定位问题、div 问题、页脚问题还是 iframe 问题。我猜这是页脚的问题,但页脚被放置在我所有其他页面上我需要它的地方。这就是让我困惑的地方。对网页设计还是个新手,所以我仍然在思考定位属性等等。这是我所拥有的:

CSS:

/*BODY*/
html, body {
    background:White;
    font-family:Segoe UI;
    width:100%;
    margin:0;
    padding:0;
    height:100%;
}

#wrapper {
    min-height: 100%;
    position:relative;
}

#body {
    padding:10px;
    padding-bottom:460px;
}

.footer1 {
    background-color:#494949;
    display:inline-block;
    width:100%;
    height:360px;
    position:absolute;
    bottom:100px;
    left: 0;
}

.footer2 {
    background-color:black;
    display:inline-block;
    width:100%;
    height:100px;
    /*margin-top:0px;*/
    position:absolute;
    bottom:0;
    left:0;
}

HTML:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>Pagina De Informacion General</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="description" content="Slide Down Box Menu with jQuery and CSS3" />
        <meta name="keywords" content="jquery, css3, sliding, box, menu, cube, navigation, portfolio, thumbnails"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" href="CaseTypes/style.css" type="text/css" media="screen"/>
        <script src="/NewWebTest/jquery.min.js"></script>
    </head>

    <body>
        <div id="wrapper">

            <!--HEADER-->
            <div id="header">
            </div>

            <!--PAGE TITLE-->
            <div id="pageTitle">
                Pagina De Informacion General
            </div>

            <!--NAVIGATION MENU-->
            <div id="navigation">
            </div>

            <br/>

        <div id="body" style="height:100%">
        <div style="height: 532px">
            <div id="openingImage">
                <img src="../images/Blended Courthouse JPG Less Opacity.jpg" alt="Courthouse" height="274" width="1271"/>           
            </div>

            <!--DIV LEFT: ANNOUNCEMENTS-->
            <div id="annouceDiv">

                <div class="sectionHeader">
                    &nbsp&nbsp Ubicación Central
                </div>
                <br/>

                <div class="announceSection" style="text-align:center">
                    Pima County Consolidated Justice Court<br/>
                    240 N. Stone Avenue, segundo piso<br/>
                    Tucson, AZ 85701<br/>
                    (520) 724-3171 <br/><br/>   

                    Para obtener información sobre estacionamiento, visite el sitio web de la Ciudad de Tucson:<br/>
                    <a href="https://www.tucsonaz.gov/park-tucson/where-can-i-park-downtown" target="_blank">City of Tucson Downtown Parking</a>                
                </div>

                <!--SECTION DIVIDER IMAGE-->
                <div class="breakImageDiv">
                    <img src="../images/EchoPet_Line_Break_PNG.png" class="breakImagePic" alt="Divider"/>
                </div>

            </div>

            <div id="annouceDiv">

                <div class="sectionHeader">
                    &nbsp&nbsp Horario y Cierre por Dias Festivos
                </div>
                <br/>

                <div class="announceSection" style="text-align:center">
                    Lunes a Viernes, 8:00 a.m. to 5:00 p.m., excepto días festivos<br/>
                    <table style="margin:auto; width:100%">
                        <tr>
                            <td>Año Nuevo</td>
                            <td>Día del Obrero</td>
                        </tr>
                        <tr>
                            <td>Día de Martin Luther King</td>
                            <td>Día del Armisticio</td>
                        </tr>
                        <tr>
                            <td>Día de los Presidentes</td>
                            <td>Día de Acción de Gracías</td>
                        </tr>
                        <tr>
                            <td>Día de los Caídos</td>
                            <td>Día despues de Acción de Gracías</td>
                        </tr>
                        <tr>
                            <td>Día de la Independencia</td>
                            <td>Navidad</td>
                        </tr>
                    </table>                
                </div>

                <!--SECTION DIVIDER IMAGE-->
                <div class="breakImageDiv" style="width: 100%">
                    <img src="../images/EchoPet_Line_Break_PNG.png" alt="Divider" style="width:100%" height="39"/>
                </div>

            </div>

            </div>

        <div style="float:left; width:100%">
            <div id="annouceDiv" style="width:100%">

                <div class="sectionHeader" style="margin-right:60px">
                    &nbsp&nbsp Plano
                </div>
                <br/>

                <div class="announceSection" style="text-align:center; margin-right:60px">

                        <iframe 
                            src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3375.2154892306807!2d-110.97141080000001!3d32.22536379999999!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x86d6711e54972b5f%3A0x655603b7f78ec698!2s240+N+Stone+Ave%2C+Tucson%2C+AZ+85701!5e0!3m2!1sen!2sus!4v1422889378316"
                            width="95%" height="450" postion="relative" bottom="460px" frameborder="0" style="border:0">
                        </iframe>

                </div>

                <!--SECTION DIVIDER IMAGE-->
                <div class="breakImageDiv" style="width:100%">
                    <img src="../images/EchoPet_Line_Break_PNG.png" class="breakImagePic" alt="Divider" style="width:100%"/>
                </div>

                </div>

            </div>

        </div>

            <!--FOOTER-->
            <div id="footer" style="position:relative; bottom:0">
            </div>

         <!--Javascript for header, nav, and footer-->                          
        <script type="text/javascript" src="/NewWebTest/jquery.min.js"></script>
        <script type="text/javascript" src="/NewWebTest/jquery.easing.1.3.js"></script>
        <script type="text/javascript">
            $(function() {
            $("#header").load("/NewWebTest/header.html");
            $("#navigation").load("/NewWebTest/navigation.html");
            $("#footer").load("/NewWebTest/footer.html");
            });
        </script>

    </div>

</body>

</html>

中间的很多其他 CSS 样式都排好了,感觉没必要加,除非有要求。在过去的一天里,我到处都在看这里和其他文章,但找不到我要找的东西。任何帮助将不胜感激。

最佳答案

在你的<div id="footer">使用 clear:both; 添加样式它位于您的 iframe 之上的原因是因为您拥有 iframe float:left .您需要清除 float 。

关于html - IFrame 问题 : Footer is on top of iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44681405/

相关文章:

javascript - 是否可以在 Handlebars 模板中嵌套 if/else 语句?

javascript - 在移动设备上禁用输入自动缩放

html - 如何使用 HTML 和 CSS 在网站中添加不同的部分?

html - 如何使元素的内容框适合其内容的字体大小

iframe - 嵌入网站的一部分

javascript - 创建一个其他人可以嵌入到他们网站中的 GWT 小部件?

c# - 从网络中的 UNC 路径加载图像并隐藏该路径

javascript - 如何将 Javascript var 传递到 href 标签中?

html - Bootstrap 弹出窗口 3 列

javascript - 从框架中的其他 iframe 隐藏 iframe 或 div