项目中用到的一段CSS3生成的背景,非常好看。分享之。

惯例先上图,做了一个奇丑的放大镜效果。\

\


下面贴代码,注意是CSS3。


background-color: #3e404a;
	background-image: -webkit-linear-gradient(rgba(255,255,255,.05) 2px, transparent 2px),
		linear-gradient(90deg, rgba(255,255,255,.04) 2px, transparent 2px),
		linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
		linear-gradient(0deg, rgba(0,0,0,.3) 0, transparent 100px);
	background-image: -moz-linear-gradient(rgba(255,255,255,.05) 2px, transparent 2px),
		linear-gradient(90deg, rgba(255,255,255,.04) 2px, transparent 2px),
		linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
		linear-gradient(0deg, rgba(0,0,0,.3) 0, transparent 100px);
	background-image: linear-gradient(rgba(255,255,255,.05) 2px, transparent 2px),
		linear-gradient(90deg, rgba(255,255,255,.04) 2px, transparent 2px),
		linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
		linear-gradient(0deg, rgba(0,0,0,.3) 0, transparent 100px);
	background-size:100px 100px, 100px 100px, 20px 20px, 20px 20px, 100% 100%;
	background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px, center bottom;


欢迎各位留言探讨!