3

我想用不使用图像的 CSS3 和 HTML5 texhnologies 得到这个结果。

这是HTML

<div id="overlay"></div>
<div id="lines"></div>

和 CSS

body {
    background: #45484d;
    z-index:-5;
}

#lines {
      background-size: 20px 20px;    
    background-image: -webkit-repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 7px),-webkit-repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 7px);
    background-image: -moz-repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 7px),-moz-repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 7px);
    background-image: -o-repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 7px),-o-repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 7px);
    background-image:repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 7px),repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 7px);
    height:100%;
    width:100%;
    opacity:0.14;
    position:absolute;
    top:0;
    left:0;
    z-index:-4;
}

#overlay {
    position:absolute;
    top:0;
    left:0;
    height:100%;
    width:100%;
    z-index:-3;
}

我有点在 jsfiddle 上得到了一些结果:

http://jsfiddle.net/tt13/BA8Wk/2/

但想不出还能做什么。谁能帮我实现这个结果?

http://i.stack.imgur.com/6BrlY.jpg

4

2 回答 2

2

HTML

<div id="overlay"></div>
<div id="lines"></div>
<div id="lines2"></div>

CSS

body {
    background-image: -ms-radial-gradient(center, circle closest-corner, #636363 0%, #27282B 100%);
    background-image: -moz-radial-gradient(center, circle closest-corner, #636363 0%, #27282B 100%);
    background-image: -o-radial-gradient(center, circle closest-corner, #636363 0%, #27282B 100%);
    background-image: -webkit-gradient(radial, center center, 0, center center, 447, color-stop(0, #636363), color-stop(1, #27282B));
    background-image: -webkit-radial-gradient(center, circle closest-corner, #636363 0%, #27282B 100%);
    background-image: radial-gradient(circle closest-corner at center, #636363 0%, #27282B 100%);
    z-index:-5;
}

#lines {
      background-size: 20px 20px;    
    background-image: -webkit-repeating-linear-gradient(0deg, #fff, #fff 1px, transparent 2px, transparent 20px),-webkit-repeating-linear-gradient(-90deg, #fff, #fff 1px, transparent 2px, transparent 20px);
    background-image: -moz-repeating-linear-gradient(0deg, #fff, #fff 1px, transparent 2px, transparent 20px),-moz-repeating-linear-gradient(-90deg, #fff, #fff 1px, transparent 2px, transparent 20px);
    background-image: -o-repeating-linear-gradient(0deg, #fff, #fff 1px, transparent 2px, transparent 20px),-o-repeating-linear-gradient(-90deg, #fff, #fff 1px, transparent 2px, transparent 20px);
    background-image:repeating-linear-gradient(0deg, #fff, #fff 1px, transparent 2px, transparent 20px),repeating-linear-gradient(-90deg, #fff, #fff 1px, transparent 2px, transparent 20px);
    height:100%;
    width:100%;
    opacity:0.14;
    position:absolute;
    top:0;
    left:0;
    z-index:-4;
}

#lines2 {
      background-size: 100px 100px;    
    background-image: -webkit-repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 100px),-webkit-repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 100px);
    background-image: -moz-repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 100px),-moz-repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 100px);
    background-image: -o-repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 100px),-o-repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 100px);
    background-image:repeating-linear-gradient(0deg, #fff, #fff 2px, transparent 2px, transparent 100px),repeating-linear-gradient(-90deg, #fff, #fff 2px, transparent 2px, transparent 100px);
    height:100%;
    width:100%;
    opacity:0.14;
    position:absolute;
    top:0;
    left:0;
    z-index:-3;
}

#overlay {
    position:absolute;
    top:0;
    left:0;
    height:100%;
    width:100%;
    z-index:-2;
}
于 2013-01-27T14:51:10.197 回答
0

我对此的尝试(仅用于演示的 -webkit 规则(Chrome)):

background-size: 100px 100px;    

background-image:
   repeating-linear-gradient(0deg, #999, transparent 2px, transparent 20px),
   repeating-linear-gradient(0deg, #fff 1px, transparent 2px, transparent 100px),
   repeating-linear-gradient(90deg, #999, transparent 2px, transparent 20px),
   repeating-linear-gradient(90deg, #fff 1px, transparent 2px, transparent 100px);

小提琴

这是一个带有条纹的

background-size:4px 4px; 
background-image: 
  repeating-linear-gradient(45deg, transparent, transparent 1px, #333 2px, transparent 3px);
于 2013-01-27T15:11:40.383 回答