单个div+css实现一个饼干效果代码
代码语言:html
所属分类:布局界面
代码描述:仅仅使用一个div+css代码实现一个饼干效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
min-height: 325tive;
background-color: #639;
}
div {
position: absolute;
left: 50%;
top: 50%;
}
div:before,
div:after {
display: block;
content: '';
position: absolute;
}
@media (max-width: 400px) {
div {
transform: scale(0.8);
}
}
#nostalgia {
box-sizing: border-box;
font-size: 10px;
width: 35em;
height: 12em;
margin-left: -17.5em;
margin-top: -6em;
background-repeat: no-repeat;
background-image: linear-gradient(80deg, rgba(255,255,255,0.2) 20%, rgba(255,255,255,0) 40%), linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0.2), rgba(255,255,255,0)), linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0.2), rgba(255,255,255,0)), linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0.2), rgba(255,255,255,0)), linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0.2), rgba(255,255,255,0)), linear-gradient(to bottom, rgba(255,255,255,0.25) 40%, rgba(255,255,255,0.15) 50%), linear-gradient(to right, rgba(102,51,153,0), #4c2673, #4c2673, rgba(102,51,153,0)), linear-gradient(to right, rgba(102,51,153,0), #47246b, #47246b, rgba(102,51,153,0));
background-size: 5% 20%, 0.2em 40%, 0.2em 40%, 20% 0.2em, 20% 0.2em, 100% 100%, 30% 50%, 40% 50%;
background-position: 1% 97%, 0 40%, 100% 0, 10% 0, 95% 100%, 0 0, 90% 0, 60% 100%;
box-shadow: 0 2em 0 -1em rgba(0,0,0,0.2);
}
#nostalgia:before,
#nostalgia:after {
height: 10em;
top: 1em;
background-repeat: no-repeat;
border-radius: 2em;
}
#nostalgia:before {
width: 9em;
left: 1em;
background-color: #ffd700;
background-image: radial-gradient(circle, #.........完整代码请登录后点击上方下载按钮下载查看
网友评论0