纯css实现金属立体材质文字效果
代码语言:html
所属分类:布局界面
代码描述:纯css实现金属立体材质文字效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
* {
-webkit-backface-visibility: hidden;
}
html, body {
height: 100%;
width: 100%;
}
body {
background: linear-gradient(135deg, #444 0%, #222 100%) fixed;
}
/* Positioning */
ol {
list-style-type: none;
margin: 0;
padding: 40px;
text-indent: 0;
width: 80%;
margin: 0 auto;
text-align: center;
}
/* Layout properties */
li {
-webkit-filter: drop-shadow(32px 48px 8px rgba(0, 0, 0, 0.4));
filter: drop-shadow(32px 48px 8px rgba(0, 0, 0, 0.4));
display: inline-block;
/* Adjust for spacing */
margin: 50px 40px;
position: relative;
/* horizontal grid */
/* vertical grid */
}
li:before, li:after {
display: none;
/* comment out to see grid lines */
content: '';
position: absolute;
top: 0;
left: 0;
margin: auto;
background: rgba(255, 0, 0, 0.5);
z-index: 1;
}
li:before {
width: 1px;
height: 100%;
right: 0;
}
li:after {
width: 100%;
height: 1px;
bottom: 0;
box-shadow: 0 -50px 0 0 rgba(255, 0, 0, 0.5), 0 22px 0 0 rgba(255, 0, 0, 0.5), 0 8px 0 0 rgba(255, 0, 0, 0.5);
}
div {
position: absolute;
font-size: 0;
color: transparent;
border-style: solid;
}
div span {
position: absolute;
display: block;
border-style: solid;
}
.a {
width: 100px;
height: 110px;
}
.a div {
height: 20px;
width: 4px;
background: #DFE0E3;
margin: 0 auto;
top: 12px;
left: 50px;
}
.a div:before {
content: "";
position: absolute;
display: block;
border-style: solid;
top: -3px;
height: 88px;
left: -33px;
border-color: transparent #C5C6C8 #A7AAAB #DFE0E3;
border-width: 0 10px 10px 10px;
-webkit-transform: skew(-22deg);
transform: skew(-22deg);
box-shadow: -5px -16px 0 -5px #DFE0E3;
background: #C5C6C8;
z-index: -1;
}
.a div:after {
content: "";
position: absolute;
display: block;
border-style: solid;
top: 21px;
left: 12px;
height: 64px;
border-color: transparent #C5C6C8 #A7AAAB #DFE0E3;
border-width: 0 10px 10px 10px;
-webkit-transform: skew(22deg);
transform: skew(22deg);
box-shadow: 5px -40px 0 -5px #C5C6C8;
background: #C5C6C8;
}
.a span {
top: -15px;
left: -9px;
border-color: #F3F3F3 transparent transparent transparent;
border-width: 12px 6px 0 6px;
z-index: 1;
}
.a span:before {
content: "";
position: absolute;
display: block;
border-style: solid;
top: 58px;
left: -24px;
width: 35px;
border-width: 10px 7px;
border-color: #A7AAAB transparent transparent transparent;
}
.a span:after {
content: "";
position: absolute;
display: block;
border-style: solid;
top: 46px;
left: -24px;
width: 23px;
border-width: 6px 13px;
border-color: transparent transparent #F3F3F3 transparent;
}
.b {
width: 92px;
height: 110px;
}
.b div {
height: 90px;
width: 20px;
border-color: #F3F3F3 transparent #A7AAAB #DFE0E3;
border-width: 10px;
}
.b div:before {
content: "";
position: absolute;
display: block;
border-style: solid;
width: 52px;
height: 25px;
left: 0;
top: 45px;
border-top-right-radius: 22px;
border-bottom-right-radius: 22px;
border-color: #A7AAAB #DFE0E3 #F3F3F3 #C5C6C8;
border-width: 10px;
}
.b div:after {
content: "";
position: absolute;
display: block;
border-style: solid;
top: 0;
width: 52px;
height: 25px;
left: 0;
border-top-right-radius: 22px;
border-bottom-right-radius: 22px;
border-color: #A7AAAB #DFE0E3 #F3F3F3 #C5C6C8;
border-width: 10px;
}
.b span {
top: -10px;
left: 0;
width: 62px;
height: 45px;
border-top-right-radius: 33px;
border-bottom-right-radius: 33px;
border-color: #F3F3F3 #C5C6C8 transparent transparent;
border-width: 10px;
}
.b span:after {
content: "";
position: absolute;
display: block;
border-style: solid;
top: 35px;
left: -10px;
width: inherit;
height: 45px;
border-top-right-radius: 33px;
border-bottom-right-radius: 33px;
border-color: transparent #C5C6C8 #A7AAAB transparent;
border-width: 10px;
}
.b span:before {
content: "";
position: absolute;
display: block;
border-style: solid;
width: 16px;
height: 5px;
background: #A7AAAB;
box-shadow: 0 5px 0 0 #F3F3F3;
top: 35px;
right: 0;
z-index: -1;
}
.c {
width: 94px;
height: 110px;
}
.c div {
top: 10px;
left: 10px;
width: 70px;
height: 70px;
border-radius: 100%;
border-width: 10px;
border-color: #A7AAAB transparent #F3F3F3 #C5C6C8;
}
.c div:before {
content: "";
position: absolute;
display: block;
border-style: solid;
width: 90px;
height: 90px;
border-radius: inherit;
border-width: 10px;
border-color: #F3F3F3 transparent #A7AAAB #DFE0E3;
top: -20px;
left: -20px;
}
.c span {
display: block;
position: absolute;
right: -3px;
top: -3px;
border-width: 13px 13px 0 0;
border-color: #C5C6C8 transparent transparent transparent;
}
.c span:before {
content: "";
position: absolute;
display: block;
border-style: solid;
top: 50px;
right: -13px;
border-width: 13px 0 0 13px;
border-color: transparent transparent transparent #C5C6C8;
}
.d {
width: 92px;
height: 110px;
}
.d div {
height: 90px;
width: 72px;
left: 0;
top: 0;
border-color: #F3F3F3 #C5C6C8 #A7AAAB #DFE0E3;
border-width: 10px;
border-top-right-radius: 46px;
bor.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0