google-chrome - Chrome 下拉阴影框出现在 div 上

标签 google-chrome z-index css

我试图让阴影出现在我的 div 下。到目前为止,它适用于除 chrome/chromium 之外的任何东西。 简单地说,即使设置了 z-index 属性,绘制阴影的 div 也没有显示,阴影出现在 div 上。 HTML 看起来像这样:

<body>  
<div id="header" class="box clear">
    <div id="logo">
       <img class="obraz_srodek" src="http://ocento.hol.es/tz/logotyp.png" title="ocentologotype"/>

    </div>

</div>
<div class="content">// Javascript/jQuery soon</div>​​​
<div id="test">Padding test</div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

我的css文件是这样的:

body
{
background-image:url('bg.jpg');
background-repeat: repeat;
}

html{
  height: 100%;
  width: 98%;
    padding:0;
    margin:0;
}
body {
  min-height: 100%;
  min-width:98%;

}

.content{
    padding-top:55px;

}

.obraz_srodek {
    overflow:hidden;
    height:25px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding-top:7px;

}
#header
{
    position: fixed;
    background-color: white;
    min-height: 40px;
    min-width: 100%;
    top: 0px;
    left: 0px;


}

.box {
  position: relative;

  background-color: #fff;
  box-shadow: 0 0px 5px rgba(0,0,0,0.25), 0 0 5px rgba(0,0,0,0.1) inset;
  border-radius: 1%     1%     1%     1% /     1%     1%     1%     1%;
}
.box:after {
      position: absolute;
      width: 80%;
      height: 40%;
      left: 10%;
      border-radius: 50%;
      z-index: -4;
      bottom: 0%;
      content: "";
      box-shadow: 0 7px 16px rgba(0,0,0,0.4);
      }

最佳答案

是这样的吗?我移动了 div.box 以达到效果,chrome 不能用你的方法做到这一点 jsFiddle here

<div id="header" class="clear">
    <div class="box">
        <div id="logo">
            <img class="obraz_srodek" src="http://ocento.hol.es/tz/logotyp.png" title="ocentologotype"/>

        </div>
    </div>
</div>

关于google-chrome - Chrome 下拉阴影框出现在 div 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16560191/

相关文章:

google-chrome - 将 Cloud firestore 库添加到 chrome 扩展 content_scripts

html - 什么是<<伪:before>></<pseudo:before>> and is it useful to me?

html - 将相同大小的 div 叠加在父级之上

CSS 变换在 Chrome 中的可见性

android - Chrome/Android Jingle-SDP ICE 连接失败

Chrome HTTP RANGE 中的 PHP 下载恢复无法正常工作

html - 在 IE7 下为 li 元素放置一个 div 掩码

javascript - 透明背景颜色内的图像不受影响

html - 在 Bootstrap 4 中将一行分成 5 列?

html - 有没有办法制作固定的背景图像而没有滞后?