纯css实现的城堡效果
代码语言:html
所属分类:布局界面
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> #tower { --sX: 60px; --sY: 60px; --sZ: 140px; --cF: #FFF; --cS: #F6F6F6; } #tower .face-front { border-top: 7px solid #E6E6E6; border-bottom: 10px solid #F6F6F6; display: flex; flex-direction: column; justify-content: space-between; align-items: center; } #tower .face-front .window { width: 40px; height: 40px; margin-top: 10px; background-color: #888; border-top: 2px solid #AAA; border-right: 7px solid #BBB; border-radius: 23px 23px 0 0; } #tower .face-front .door { width: 30px; height: 40px; margin-bottom: -10px; background-color: #B96; border-top: 1px solid #CCC; border-right: 5px solid #DDD; border-radius: 15px 15px 0 0; } #tower .face-side { border-right: 7px solid #BBB; border-left: 10px solid #DDD; display: flex; justify-content: flex-end; align-items: center; } #tower .face-side .window { width: 40px; height: 40px; margin-right: 10px; background-color: #666; border-top: 7px solid #BBB; border-right: 2px solid #AAA; border-radius: 0 23px 23px 0; } #tower-roof { --sX: 70px; --sY: 70px; --sZ: 100px; --pZ: 135px; --cF: #F96; --cS: #E74; } #left-wall { --sX: 80px; --sY: 240px; --sZ: 100px; --pX: 40px; --pY: -150px; --cS: #EEE; --cT: #E74; } #left-wall .face-side { padding: 45px 0; border-right: 5px solid #CCC; border-left: 10px solid #DDD; display: flex; flex-direction: column; justify-content: space-around; align-items: center; } #left-wall .face-side .window { width: 30px; height: 63px; background-color: #666; border-top: 2px solid #AAA; border-left: 7px solid #BBB; border-radius: 15px 15px 0 0; transform: rotate(90deg); } #left-wall .face-top { transform: translateZ(var(--sZ)) rotateY(-45deg) translateZ(33px); } #right-wall { --sX: 340px; --sY: 80px; --sZ: 60px; --pX: 200px; --pY: -40px; --cT: #F96; --cF: #FFF; } #right-wall .face-front { padding: 0 45px; display: flex; border-top: 7px solid #DDD; border-bottom: 10px solid #EEE; justify-content: space-around; align-items: center; } #right-wall .face-front .window { width: 30px; height: 33px; background-color: #888; border-top: 2px solid #BBB; border-right: 7px solid #CCC; border-radius: 15px 15px 0 0; } #right-wall .face-top { transform: translateZ(var(.........完整代码请登录后点击上方下载按钮下载查看
网友评论0