我已经阅读了很多关于这个问题的话题,但到目前为止还没有任何工作.我读过的最简单的方法是使用盒子阴影,但这会导致阴影的颜色与盒子的颜色不同,即使颜色的代码是相同的(#141414).
题
如何为div框获得淡出/模糊边框?这很难以书面形式解释,所以我制作了这个图像给你的想法(忽略背景).如果你仔细观察,你可以看到混合,颜色是均匀的,褪色到透明.
我说的盒子阴影对我不起作用.
body {
background-image:url('http://phptesting.altervista.org/tessuto.png');
background-repeat: repeat;
}
div {
width: 300px;
height: 300px;
background-color: #141414;
border: 2px solid #141414;
box-shadow: 0 0 5px 5px #141414;
border-radius: 10px;
}Run Code Online (Sandbox Code Playgroud)
<html>
<body>
<div></div>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
这是我的项目:http://jsfiddle.net/yL0o1cy0/
.calendar {
width: 850px;
height: 500px;
background-color: #141414;
border-radius: 10px;
padding-top: 10px;
margin-top: 15px;
margin-left: 15px;
}
#calendartest1 {
width: 778px;
height: 200px;
position: relative;
margin-left: auto;
margin-right: auto;
}
#calendartest2 {
width: 778px;
height: 200px;
position: relative;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
}
#calendartest1 h2 {
color: #999999;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
#calendartest2 h2 {
color: #999999;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
.day {
width: 110px;
float: left;
border-left: …Run Code Online (Sandbox Code Playgroud)