单个div+css布局实现一个树螽代码
代码语言:html
所属分类:布局界面
代码描述:仅仅使用一个div加上一些css代码就绘制了一个类似蜥蜴的动物树螽。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { min-height: 250px; height: 100vh; position: relative; background-color: #ffffe0; text-align: center; } 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); } } #camouflage { font-size: 10px; width: 25em; height: 15em; margin-left: -11em; margin-top: -7em; background-color: #2e8b57; background-repeat: no-repeat; background-image: linear-gradient(150deg, rgba(255,255,255,0) 49.5%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 50.5%, rgba(255,255,255,0) 51%), linear-gradient(105deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.17) 49%, rgba(255,255,0,0.17) 52%, rgba(255,255,0,0) 53%), linear-gradient(108deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(108deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(108deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(108deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(110deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.16) 49%, rgba(255,255,0,0.16) 52%, rgba(255,255,0,0) 53%), linear-gradient(113deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.16) 49%, rgba(255,255,0,0.16) 52%, rgba(255,255,0,0) 53%), linear-gradient(125deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.2) 49%, rgba(255,255,0,0.2) 52%, rgba(255,255,0,0) 53%), linear-gradient(to bottom, rgba(255,255,0,0), rgba(255,255,0,0.15), rgba(255,255,0,0.15), rgba(255,255,0,0)), linear-gradient(to bottom, rgba(255,255,0,0), rgba(255,255,0,0.15), rgba(255,255,0,0.15), rgba(255,255,0,0)), linear-gradient(177deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(175deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(175deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(175deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.14) 49%, rgba(255,255,0,0.14) 52%, rgba(255,255,0,0) 53%), linear-gradient(172deg, rgba(255,255,0,0) 47%, rgba(255,255,0,0.16) 49%, rgba(255,255,0,0.16) 52%, rgba(255,255,0,0) 53%), repeating-linear-gradient(25deg, rgba(0,0,0,0), rgba(0,0,0,0) 0.5em, rgba(0,0,0,0.03) 0.55em, rgba(0,0,0,0.03) 0.6em, rgba(0,0,0,0) 0.65em), repeating-linear-gradient(-45deg, rgba(0,0,0,0), rgba(0,0,0,0) 0.5em, rgba(0,0,0,0.05) 0.55em, rgba(0,0,0,0.05) 0.6em, rgba(0,0,0,0) 0.65em), linear-gradient(150deg, rgba(255,255,0,0) 45%, rgba(255,255,0,0.17) 49%, rgba(255,255,0,0.17) 51%, rgba(255,255,0,0) 55%), radial-gradient(circle at 40% 50%, rgba(255,255,0,0.4) 0, rgba(255,255,0,0) 90%), linear-gradient(45deg, rgba(144,238,144,0) 10%, #90ee90 100%); background-size: 90% 90%, 4em 20%, 4em 40%, 4em 55%, 4em 55%, 4em 40%, 4em 40%, 4em 30%, 4em 20%, 5em 0.3em, 8em 0.3em, 12em 5em, 12em 5em, 9em 5.2em, 7em 5.2em, 5em 5.2em, 100% 100%, 100% 100%, 100% 100%,.........完整代码请登录后点击上方下载按钮下载查看
网友评论0