以下是 纯CSS3绘制的砖墙效果代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>纯CSS3绘制的砖墙效果代码</title>
<link href="css/zzsc.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="wall"><h1>ANOTHER BRICK<br>IN<br>内容</h1></div>
</body>
</html>
CSS代码(zzsc.css):
.wall{width:600px;height:300px;margin:50px auto;font-family:'Shadows Into Light',cursive;text-align:center;color:#000;background-image:-webkit-radial-gradient(center center,ellipse farthest-corner,transparent 0%,transparent 10%,rgba(0,0,0,0.8) 100%),-webkit-linear-gradient(top,#555 0%,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-webkit-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-webkit-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%),-webkit-linear-gradient(left,#555 0px,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-webkit-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-webkit-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%);background-image:-moz-radial-gradient(center center,ellipse farthest-corner,transparent 0%,transparent 10%,rgba(0,0,0,0.8) 100%),-moz-linear-gradient(top,#555 0%,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-moz-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-moz-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%),-moz-linear-gradient(left,#555 0px,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-moz-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-moz-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%);background-image:-ms-radial-gradient(center center,ellipse farthest-corner,transparent 0%,transparent 10%,rgba(0,0,0,0.8) 100%),-ms-linear-gradient(top,#555 0%,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-ms-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-ms-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%),-ms-linear-gradient(left,#555 0px,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-ms-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-ms-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%);background-image:-o-radial-gradient(center center,ellipse farthest-corner,transparent 0%,transparent 10%,rgba(0,0,0,0.8) 100%),-o-linear-gradient(top,#555 0%,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-o-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-o-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%),-o-linear-gradient(left,#555 0px,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),-o-linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),-o-linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%);background-image:radial-gradient(center center,ellipse farthest-corner,transparent 0%,transparent 10%,rgba(0,0,0,0.8) 100%),linear-gradient(top,#555 0%,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%),linear-gradient(left,#555 0px,#555 1px,transparent 1px,transparent 14px,#555 14px,#555 16px,transparent 16px,transparent 29px,#555 29px,#555 30px),linear-gradient(45deg,#ddd 0%,#ddd 25%,transparent 25%,transparent 75%,#eee 75%,#eee 100%),linear-gradient(45deg,#eee 0%,#eee 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd 100%);background-position:0 0,0 0,13px 0,28px 15px,0 0,0 0,15px 15px;background-size:600px 300px,30px 30px,30px 30px,30px 30px,30px 30px,30px 30px,30px 30px;background-repeat:repeat;}
.wall h1{padding:75px;margin:0;font-size:50px;line-height:50px;text-shadow:0 5px 5px rgba(0,0,0,0.9);}