2013-02-28 151 views
0

我有以下的HTML源代碼: 圖像陰影

<div id="page"> 
     <div id="header"> 
      <!-- end header div --> 
     </div> 
     <div id="dropdown"> 
     <!--navigator menu is here!--> 
     </div> 

    <div id="main"> 
<!--main is here!--> 
    </div> 
     <div id="sidebar"> 
      <!--sidebar menu is here!--></div> 
     <div id="footer"> 

     </div> 
     <!-- end page div --> 
    </div> 
    <div id="leftshadow"></div> 
    <div id="rightshadow"></div> 
</body> 

這是CSS源

/* html selectors ---- */ 

html, body { 
    font-family: 'Arial Unicode MS'; 
    margin: 0; 
    padding: 0; 
    background-repeat: repeat-x; 
    background-color: white; 
    direction: rtl; 
    font-size: 10.3pt; 
} 



/*page -----------*/ 
#page { 
    width: 900px; 
    padding: 0px; 
    margin: 0 auto; 
    direction: rtl; 
    position: relative; 
    z-index: 100; 
    z-index: 5; 
    background-image: url("images/bgimage.png"); 
} 

#leftshadow { 
    width: 100px; 
    height: 900px; 
    background-image: url("images/leftshadow.png"); 
    position: absolute; 
    right: 1220px; 
    z-index: none; 
    top: -50px; 
} 

#rightshadow { 
    width: 100px; 
    height: 900px; 
    background-image: url("images/rightshadow.png"); 
    position: absolute; 
    right: 345px; 
    z-index: none; 
    top: -25px; 
} 


/* header ---------- */ 

#header { 
    height: 110px; 
    top: 0px; 
    line-height: 30px; 
    background-image: url("images/header.png"); 
    background-position-x: center; 
    background-repeat: repeat-x; 
} 


/* main -------------- */ 



#main { 
    line-height: 21px; 
    font-family: arial; 
    width: 625px; 
    padding: 30px; 
    position: relative; 
    right: 205px; 
    padding-bottom: 80px; 
    direction: rtl; 
    top: 42px; 
    padding-right: 60px; 
    min-height: 750px; 

     text-align: justify; 

} 

通常情況下,我得到這個結果what I want

但在Internet-Explorer我得到了這個結果What I get

我知道如果我會插入

<div id="leftshadow"></div> 
     <div id="rightshadow"></div> 

****** Live example here! http://lawb.co.il/ ******

進入#page事業部的問題可以解決,但唯一的問題是,比complatly上的內容的影子,UND不behund他

你認罪能幫助我有了這個?

希望得到幫助,謝謝!

+0

您是否正在使用CSS重置? – 2013-02-28 21:39:58

+0

@KrisHollenbeck什麼是CSS重置? – 2013-02-28 21:44:54

+0

它將您所有的瀏覽器CSS重置爲零,因此它們都是一樣的。默認情況下,所有瀏覽器都會在HTML元素上設置不同類型的填充和邊距。強烈建議每次創建新的Web項目時使用一個。它可以防止瀏覽器之間的佈局不一致。 http://meyerweb.com/eric/tools/css/reset/ – 2013-02-28 21:56:19

回答

0

任何原因爲什麼你可以使用圖像來創建陰影,當你可以使用CSS3 box-shadow

如果你要使用這種方法,我會改變你的HTML結構如下所示:

<div id="page"> 
    <div id="leftshadow"></div> 
    <div id="header"> 
     <!-- end header div --> 
    </div> 
    <div id="dropdown"> 
     <!--navigator menu is here!--> 
    </div> 

    <div id="main"> 
     <!--main is here!--> 
    </div> 
    <div id="sidebar"> 
     <!--sidebar menu is here!--> 
    </div> 
    <div id="footer"> 
     <!-- footer --> 
    </div> 
    <!-- end page div --> 
    <div id="rightshadow"></div> 
</div> 

然後浮動權陰影格的權利和左側陰影DIV左側。很可能你會看到不一致,因爲 你沒有使用重置,並且東西相對定位。如果在#page容器內不需要絕對定位,您實際上不需要定位相對位置和陰影。

+0

我使用圖像因爲它不是普通的陰影,它是非常複雜的創建它在CSS陰影(這是圖像:http://lawb.co.il/images/leftshadow.png) 我試圖使用CSS重置 - 並將shaows div插入到頁面div中,但頁面Div仍位於其上方... – 2013-02-28 22:07:48