div+css实现卡通狗邮票效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现卡通狗邮票效果代码

代码标签: div css 卡通 邮票

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    body {
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: teal;
}

.stamp {
    width: 40.5em;
    height: 73em;
    font-size: 6px;
    padding: 5em;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-direction: column;
}

.stamp::before,
.stamp::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, teal 50%, transparent 50%),
        radial-gradient(circle, teal 50%, transparent 50%);
    background-size: 3.5em 3.5em;
}

.stamp::before {
    background-repeat: repeat-y;
    top: 1.5em;
    background-position: -4.5% 0, 104.5% 0;
}

.stamp::after {
    background-repeat: repeat-x;
    left: 1.5em;
    background-position: 0 -2.5%, 0 102.5%;
}

.puppy {
    display: grid;
    grid-template-columns: 10em 22.5em 8em;
    grid-template-rows: 21em 12.5em 3.75em 22.5em;
    background-color: tan;
    padding: 2em;
    margin-top: -2em;
}

.head {
    grid-column: 1 / 3;
    grid-row: 2 / 4;
    background-color: bisque;
    border-bottom-left-radius: calc(12.5em + 3.75em);
    border-bottom-right-radius: calc(12.5em + 3.75em);
    position: relative;
    overflow: hidden;
}

.head::before {
    content: '';
    position: absolute;
    width: 7em;
    height: 7em;
    background-color: sienna;
    border-bottom-right-radius: 100%;
}

.eyes {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    height: 10.5em;
    width: 21em;
    background-color: sienna;
    justify-self: end;
    border-radius: 0 0 10.5em 10.5em;
    background-image: radial-gradient(
        circle at 37% 33%,
        black 1.4em,
        transparent 1.4em
    );
}

.ear {
    grid-column: 2;
    grid-row: 1;
    width: 10.5em;
    background-color: sienna;
    justify-self: end;
    border-radius: 21em 0 0 21em;
}

.tongue {
    grid-co.........完整代码请登录后点击上方下载按钮下载查看

网友评论0