css布局实现早上一杯咖啡效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局实现早上一杯咖啡效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Bevan&family=Monoton&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position: relative;
width: 100vw;
max-width: 60rem;
height: 100vh;
margin: auto;
padding: 3rem;
overflow: hidden;
background: linear-gradient(to bottom right, #eef0da, #bededd);
display: flex;
flex-flow: column nowrap;
align-items: center;
align-content: center;
justify-content: center;
}
.shadow {
position: absolute;
width: 80rem;
height: 29.9rem;
top: 32rem;
left: 3.45rem;
background: #98b0b0;
z-index: -2;
transform-origin: 50% 50%;
transform: rotate(45deg);
}
.shadow:before {
content: "";
position: absolute;
width: 8rem;
height: 3rem;
top: -6rem;
right: 66.3rem;
background: transparent;
border-radius: 0 3rem 0 0;
border: 2.25rem solid #98b0b0;
z-index: -2;
}
.coffee {
position: relative;
width: 100%;
height: 100%;
z-index: -1;
}
.coffee__saucer {
position: absolute;
width: 35rem;
height: 35rem;
top: 0rem;
left: 0rem;
border-radius: 50%;
background: #f4d2a2;
z-index: -1;
overflow: hidden;
box-shadow: inset #fae6ce 0.5rem 0.5rem;
}
.coffee__saucer__shadow {
position: absolute;
width: 25rem;
height: 25rem;
top: 13rem;
left: 13rem;
background: #c1a784;
z-index: -2;
transform-origin: 50% 50%;
transform: rotate(45deg);
}
.coffee__saucer__shadow:before {
content: "";
position: absolute;
width: 8rem;
height: 3rem;
top: -6rem;
right: 11rem;
background: #f4d2a2;
border-radius: 0 3rem 3rem 3rem;
border: 2.25rem solid #c1a784;
z-index: -2;
}
.coffee__mug {
position: absolute;
top: 5rem;
left: 5rem;
width: 25rem;
height: 25rem;
border-radius:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0