纯css实现将图片变成书本效果
代码语言:html
所属分类:布局界面
代码描述:纯css实现将图片变成书本效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>BFW NEW PAGE</title> <style> .book { width: 18.5em; height: 23.0991em; margin-top: -4.4em; position: relative; -webkit-transform: perspective(60em) rotateX(58deg) rotateZ(-34deg) skewY(-7deg); transform: perspective(60em) rotateX(58deg) rotateZ(-34deg) skewY(-7deg); box-shadow: -1.4em 1.7em 0.3em -0.3em rgba(0,0,0,0.8), -1.6em 1.8em 0.9em -0.2em rgba(0,0,0,0.5), 0.3em 1.9em 1.3em rgba(0,0,0,0.3); border-top-right-radius: 0.4em; } .book img { border-top-right-radius: 0.4em; box-sizing: border-box; width: 100%; clip: rect(0em, 18.5em, 23.1em, 0em); display: block; position: absolute; -webkit-filter: saturate(90%); filter: saturate(90%); } .book:before, .book:after { content: ''; position: absolute; top: 0; } .book:before { width: 105%; height: 105%; left: -5%; z-index: -1; background-repeat: no-repeat; background-image: linear-gradient(115deg, transparent 2.8%, #3f3f3f 3%, #3f3f3f 16%, transparent 16%), linear-gradient(125deg, transparent 10%, #3f3f3f 10%, #3f3f3f 17%, #222 46.8%, transparent 47%), linear-gradient(125deg, transparent 46%, rgba(0,0,0,0.5) 46.5%, rgba(0,0,0,0.25) 49%, transparent 53%), linear-gradient(to right, #444, #666), linear-gradient(#444, #444), linear-gradient(140deg, transparent 45%, #eee 45%, #ccc 96.8%, rgba(170,170,170,0) 97%); background-size: 100% 100%, 100% 100%, 100% 100%, 100% 0.4em, 94% 0.2em, 100% 100%; background-position: 0 0, 0 0, 0 0, 0 95.8%, 0 100%, 0 0; } .book:after { width: 100%; height: 100%; background-repeat: no-repeat; background-image: linear-gradient(toright, transparent 2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0