【发布时间】:2021-03-31 16:40:45
【问题描述】:
【问题讨论】:
-
包含你的一些代码,看看这个stackoverflow.com/help/minimal-reproducible-example 截图并没有什么帮助。
-
抱歉,我没有添加,因为我的代码有很多不同的东西。不管怎样,我按照你说的做了,它解决了我的问题。
【问题讨论】:
我给你举了一个例子,你可以在页眉和页脚添加box-shadow,这样你就可以在元素之间创建模糊效果。
body{
background-color: #888888;
}
header{
width: 100%;
height: 50px;
box-shadow: 0 10px 8px 10px #888888;
background-color: #888888;
/* this is important so the box-shadow is displayd on top of the next element */
position: relative;
z-index: 1
}
div{
width: 100%;
height: 100px;
background-color: red;
}
<body>
<header></header>
<div> </div>
</body>
【讨论】: