单个div+css实现插在石头中的宝剑效果代码
代码语言:html
所属分类:布局界面
代码描述:单个div+css实现插在石头中的宝剑效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
min-height: 400px;
height: 100vh;
position: relative;
background-color: #2f4f4f;
}
div {
position: absolute;
left: 50%;
top: 50%;
}
div::before {
display: block;
content: '';
position: absolute;
}
#mythical {
width: 250px;
height: calc(100% - 50px);
margin-left: -125px;
top: 0;
background: linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.05) 70%) 79% 0/0.5em 100%, linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,255,255,0.05) 80%) 80% 0/2em 100%, linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.05) 70%) 60% 0/1em 100%, linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.05) 70%) 26% 0/0.5em 100%, linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.05) 70%) 25% 0/3em 100%, linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(255,255,255,0.05) 80%) 12% 0/0.5em 100%, linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(255,255,255,0.05) 80%) 90% 0/0.5em 100%, linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0.05) 20%) 47% 0/1.8em 100%;
background-repeat: no-repeat;
}
#mythical::before {
width: 100%;
height: 300p.........完整代码请登录后点击上方下载按钮下载查看
网友评论0