简体   繁体   English

相同的标记和CSS在ie8不同的页面上看起来不同

[英]Same markup and css looks different on ie8 different pages

I have to build a WordPress theme as a personal project. 我必须将WordPress主题构建为个人项目。 After testing it in IE8 the footer seems to not be showing the correct way on all pages. 在IE8中对其进行测试后,页脚似乎并未在所有页面上都显示正确的方式。 Which is very weird because all pages footers have the same styling. 这很奇怪,因为所有页面页脚都具有相同的样式。

I even deactivated all the styling in IE8 developer tools but the problems still persist. 我什至取消了IE8开发人员工具中的所有样式,但问题仍然存在。

In the contact page, the footer seems to be on the very far left corner making only half the footer visible. 在联系页面中,页脚似乎位于最左角,因此只能看到一半的页脚。

On the blog page, the footer seems to be getting 960px width and it is centered. 在博客页面上,页脚似乎越来越宽960px,并且居中。

On the rest of the pages, the footer looks ok. 在其余页面上,页脚看起来正常。

As I mentioned above all footer pages have the same styling so I have no idea why on different pages the footer is shown differently 正如我上面提到的,所有页脚页面都具有相同的样式,所以我不知道为什么在不同的页面上页脚显示方式不同

Here is the website: website 这是网站: 网站

I am posting my entire footer markup and CSS because I have no idea what kind of CSS mistake could make IE8 show the same markup and CSS differently on different pages: 我要发布整个页脚标记和CSS,因为我不知道哪种CSS错误会使IE8在不同页面上显示相同标记和CSS的方式有所不同:

Html: HTML:

<footer>
    <div class="center">
          <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Sidebar') ) : ?>  
          <h2 class="widget-title">No Widgets added</h2>  
          <p>Please login and add some widgets to this sidebar</p>  
          <?php endif ?>     
     </div>
        <div id="copyright">
            <p>&copy; Copyright <?=date('Y');?> <?php bloginfo('name'); ?> by <a href="<?php echo AUTHOR_URL ?>"><?php echo AUTHOR ?></a> All Rights Reserved.</p>
        </div>
       <?php wp_footer(); ?>
</footer>

CSS: CSS:

 footer{
        background:url(img/footer.png) repeat-x #1a1a1a;
        padding:33px 0;
    }
    footer div.center{
        overflow:hidden;
    }
    footer div.center div.boxFooter{
        display: inline-block;
        float:left;
        width:210px;
        margin-left: 40px;
    }
    footer div.center div.boxFooter:first-child{
        margin-left: 0;
    }
    footer div.center div h2{
        color:#cccccc;
        font-size: 20px;
        padding-bottom: 12px;
        border-bottom: 1px solid #ccc;
    }
    footer div.center div li{
        padding:10px 0;
        border-bottom:1px solid #b6b6b6;
    }footer div.center div li:last-child{
        border:none;
    }
    footer div.center div li a{
        text-decoration: none;
        color:#b6b6b6;
    }
    footer div.center div li a:hover{
        text-decoration: underline;
    }
    footer div.center div p{
        margin-top: 10px;
        text-align: justify;
        color:#b6b6b6;
    }
    footer form#searchform input{
        border-radius:5px;
        margin-top: 15px;
    }
    div#copyright{
        width:960px;
        margin:0 auto;
        border-top:1px solid #b6b6b6;
        margin-top:25px;
        color:#b6b6b6;
    }
    div#copyright p{
        margin-top:30px;
        text-align: center;
    }
    div#copyright p a{
        color:#1fa2e1;
        text-decoration: none;
    }
    div#copyright p a:hover{
        text-decoration:underline;
    }
    footer div.tagcloud{
        padding-top: 15px;

    }
    footer div.tagcloud a{
        color:#B6B6B6;
        text-decoration: none;
    }
    footer div.tagcloud a:hover{
        text-decoration: underline;
    }

I think you should Include Reset CSS at the top of your style.css file: 我认为您应该在style.css文件的顶部包含Reset CSS:

RESET CSS 重置CSS

Further More do websites need to look exactly the same in every browser . 此外,还有更多网站需要在每个浏览器中看起来完全相同

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM