单个div+css布局实现鱼子酱面包效果代码

代码语言:html

所属分类:布局界面

代码描述:仅使用一个div结合css代码实现上面铺满鱼子酱的面包效果代码。

代码标签: css 面包 鱼子酱

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <style>
        body {
          min-height: 250px;
          height: 100vh;
          position: relative;
          background-color: #ff6347;
          font-size: 10px;
        }
        div {
          box-sizing: border-box;
          position: absolute;
          left: 50%;
          top: 50%;
        }
        div:before,
        div:after {
          box-sizing: border-box;
          display: block;
          content: '';
          position: absolute;
        }
        @media (max-width: 400px) {
          div {
            transform: scale(0.8);
          }
        }
        #fancy {
          box-sizing: border-box;
          width: 20em;
          height: 8em;
          margin-left: -10em;
          margin-top: -5em;
          background-color: #cd853f;
          background-repeat: no-repeat;
          background-image: radial-gradient(ellipse, rgba(255,255,255,0.2) 60%, rgba(255,255,255,0) 62%), radial-gradient(ellipse, rgba(255,255,255,0.2) 60%, rgba(255,255,255,0) 62%), radial-gradient(ellipse, rgba(255,255,255,0.2) 60%, rgba(255,255,255,0) 62%), radial-gradient(ellipse, rgba(255,255,255,0.2) 60%, rgba(255,255,255,0) 62%);
          background-size: 1em 0.5em, 2em 1em, 1.4em 0.7em, 1em 0.5em;
          background-position: 0.8em 3em, 1.1em 4em, 9.9em 6.5em, 12.2em 6.5em;
          border-radius: 50%;
          border: 0.2em solid #8b4513;
          box-shadow: 0 0.6em 0 0.2em #deb887, 0 0.6em 0 0.4em #8b4513, -0.3em 2em 0 0em #cd853f, -0.3em 2em 0 0.2em #8b4513, -0.3em 2.6em 0 0.4em #deb887, -0.3em 2.6em 0 0.6em #8b4513, 0.5em 4em 0 0em #cd853f, 0.5em 4em 0 0.2em #8b4513, 0.5em 4.6em 0 0.4em #deb887, 0.5em 4.6em 0 0.6em #8b4513, 0.5em 5.7em 0 0.5em rgba(139,69,19,0.4);.........完整代码请登录后点击上方下载按钮下载查看

网友评论0