2013-02-28 153 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