2013-06-13 73 views
0

我在我的Wordpress網站上設置了一個閃屏頁,雖然在Internet Explorer中完全錯誤,但似乎在Chrome,Firefox和Safari中正確顯示。大圖像周圍有一個白色邊框,可點擊的徽標和社交媒體框已被推到大圖像下方,並在其周圍有藍色邊框。Internet Explorer上不兼容的閃屏頁

http://www.emma-saunders.net/

我用下面的代碼來設置它:

<img id="bg-im" src="http://www.emma-saunders.net/wp-content/uploads/2013/06/splash-1.png"> 

      <nav id="nav-social"> 

       <ul> 

        <li><a href="https://www.facebook.com/esaundersphotography" target="_blank"><img src="http://www.emma-saunders.net/wp-content/uploads/2013/06/facebook.png" alt="Follow Emma Saunders on Facebook" width="55" height="55"></a></li> 
        <li><a href="https://twitter.com/ESaundersphoto" target="_blank"><img src="http://www.emma-saunders.net/wp-content/uploads/2013/06/twitter.png" alt="Follow Emma Saunders on Twitter" width="55" height="55"></a></li> 
        <li><a href="mailto:[email protected]"><img src="http://www.emma-saunders.net/wp-content/uploads/2013/06/email.png" alt="Email us" width="55" height="55"></a></li> 

       </ul> 

      </nav> 

<a href="http://www.emma-saunders.net/latest-works/"><img id="logo" src="http://www.emma-saunders.net/wp-content/uploads/2013/06/emma-saunders-logo.png"></a> 

<style type="text/css"> 
#bg-im { 
    /* Set rules to fill background */ 
    min-height: 100%; 
    min-width: 1024px; 

    /* Set up proportionate scaling */ 
    width: 100%; 
    height: auto; 

    /* Set up positioning */ 
    position: fixed; 
    top: 0; 
    left: 0; 

    z-index: -1; 
} 

@media screen and (max-width: 1024px) { /* Specific to this particular image */ 
#bg-im { 
    left: 50%; 
    margin-left: -512px; /* 50% */ 
    } 
} 

ul { 
    list-style: none; 
} 

#nav-social { 
    position: absolute; 
    top: 0px; 
    right: 0px; 
    z-index: 100; 
} 

#nav-social li { 
    float: left; 
    border-right: 1px solid #000000; 
    background-color: #333333; 
    -webkit-transition: background-color .4; 
} 

#nav-social li a { 
    display: block; 
    overflow: hidden; 
    width: 55px; 
    height: 55px; 
} 

#nav-social li:hover { 
    background-color: #1aff94; 
} 

#logo { 
    display: block; 
    width: 900px; 
    height: 506px; 
    margin: auto; 
} 

</style> 

回答

0

首先IMG元素沒有 「/」 所以它不是關閉。

邊框問題可以通過在該溶液中固定,如:

How can I remove the outline around hyperlinks images?

最難治的部分是上IE 7和8支撐,因爲這些舊的瀏覽器不能處理這種元件,並且因此不能遵守CSS佈局規則。最好的解決辦法更多鈔票是爲了使他們能夠使用HTML 5,他們在這篇文章提示:

html5 new elements (header, nav, footer, ..) not working in IE

添加以下規則來解決這些瀏覽器的白色邊緣:

BODY { 
    margin: 0px; 
} 

應用元素的規則與所定位的規則相同。

希望這會有所幫助。

+0

即使在添加「/」 – user1652997

+0

後,我仍然在IE中遇到同樣的問題我注意到您在IE 8和7上有一個佈局問題。我嘗試另一種方法來適應控件 – Edorka

+0

謝謝您的幫助 – user1652997