一个div+css布局实现美味蛋糕效果代码
代码语言:html
所属分类:布局界面
代码描述:一个div+css布局实现美味蛋糕效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { min-height: 200px; height: 100vh; position: relative; background-color: #5f9ea0; } div { position: absolute; left: 50%; top: 50%; } div:before, div:after { display: block; content: ''; position: absolute; } @media (max-width: 400px) { div:not(.no-scale) { -webkit-transform: scale(0.8); transform: scale(0.8); } } #surreal { font-size: 18px; width: 20em; height: 10em; margin-left: -10em; margin-top: -5em; background-repeat: no-repeat; background-image: radial-gradient(ellipse, white 60%, rgba(255,255,255,0) 60.5%), radial-gradient(ellipse, #ccc 60%, rgba(255,255,255,0) 60.5%), linear-gradient(120deg, transparent 1em, #daa520 1em, #daa520 4.5em, transparent 4.5em), linear-gradient(120deg, transparent 1em, #8b4513 1em, #8b4513 1.5em, #ffb6c1 1.5em, #ffb6c1 1.7em, #8b4513 1.7em, #8b4513 2.2em, #ffb6c1 2.2em, #ffb6c1 2.4em, #8b4513 2.4em, #8b4513 2.9em, #ffb6c1 2.9em, #ffb6c1 3.1em, #8b4513 3.1em, #8b4513 3.6em, #ffb6c1 3.6em, #ffb6c1 3.8em, #8b4513 3.8em, #8b4513 4.3em, #daa520 4.3em, #daa520 4.5em, transparent 4.5em), radial-gradient(ellipse, #daa520 60%, rgba(218,165,32,0) 61%), radial-gradient(ellipse, rgba(255,255,255,0.5) 60%, rgba(255,255,255,0) 61%), radial-gradient(ellipse, #daa520 60%, rgba(218,165,32,0) 61%), radial-gradient(ellipse, rgba(255,255,255,0.5) 60%, rgba(255,255,255,0) 61%), radial-gradient(ellipse at 50% 100%, #ffd700 58.8%, rgba(255,215,0,0) 59.5%), linear-gradient(#ffd700, #ffd700), radial-gradient(ellipse, white 60%, rgba(255,255,255,0) 60.5%), radial-gradient(ellipse, #ccc 60%, rgba(255,255,255,0) 60.5%), radial-gradient(circle, black 60%, rgba(0,0,0,0) 61%), radial-gradient(circle, black 60%, rgba(0,0,0,0) 61%), radial-gradient(circle, black 60%, rgba(0,0,0,0) 61%), radial-gradient(circle, white 60%, rgba(255,255,255,0) 61%), radial-gradient(circle, #ffc0cb 30%, white 30.5%, white 60%, rgba(255,255,255,0) 61%), radial-gradient(circle, #ffc0cb 30%, white 30.5%, white 60%, rgba(255,255,255,0) 61%), radial-gradient(circle, white 60%, rgba(255,255,255,0) 61%), radial-gradient(circle, white 60%, rgba(255,255,255,0) 61%); background-size: 12em 3.2em, 12em 3.6em, 6em 0.2em, 6em 2.1em, 0.6em 0.6em, 0.6em 0.6em, 0.4em 0.4em, 0.4em 0.4em, 2em 2.5em, 2em 1em, 9em 1.6em, 9em 1.9em, 0.4em 0.4em, 0.2em 0.2em, 0.2em 0.2em, 1.5em 1.5em, 0.9em 0.9em, 0.9em 0.9em, 0.6em 0.7em, 0.6em 0.7em; background-position: 0 93%, 0 100%, right 1.55em bottom 4.5em, right 1.5em bottom 2.6em, right 1.9em bottom 3.5em, right 2em bottom 3.5em, right 2.5em bottom 2.8em, right 2.6em bottom 2.8em, right 1.4em bottom 2.6em, right 2em bottom 2.6em, right bottom 1.9em, right bottom 1.6em, left 5.45em bottom 6.9em, left 5.3em bottom 7.6em, left 5.8em bottom 7.6em, left 4.9em bottom 6.7em, left 4.7em bottom 7.7em, left 5.7em bottom 7.7em, left 4.4em bottom 6.7em, left 6.4em bottom 6.7em; } #surreal:before { width: 8em; height: 5em; left: 2em; bottom: 1.2em; background-repeat: no-repeat; background-image: radial-gradient(circle, #b68a1b 60%, rgba(218,165,32,0) 61%), radial-gradient(circle, rgba(255,255,255,0.3) 60%, rgba(255,255,255,0) 61%), radial-gradient(circle, #b68a1b 60%, rgba(218,165,32,0) 61%), radia.........完整代码请登录后点击上方下载按钮下载查看
网友评论0