2017-06-21 73 views
0

我试图在多个方向上创建多个横向背景颜色,如here身体背景颜色:多个横向和方向

我试图与background: -webkit-linear-gradient(top left, white,white 80%,#000099,#000099 20%);一起工作,但这会在一个方向上创建多个css背景色。我真正需要的是像firebase背景。

任何提示?这是我的审判:

html { 
 
    -webkit-background-size: cover; 
 
    -moz-background-size: cover; 
 
    -o-background-size: cover; 
 
    background-size: cover; 
 
    height: 100%; 
 
    min-height: 100%; 
 
} 
 
body { 
 
    /*background-color: #f3f3f3;*/ 
 
    background: -webkit-linear-gradient(top left, white,white 80%,#000099,#000099 20%); 
 
}
<div style="border: 1px solid black; background-color: White; margin-top: 150px" class="container"> 
 
    test test 
 
</div>

+3

火力地堡的背景仅仅是一个矢量图像 – IiroP

+0

尝试调整你会看到颜色改变网页,一些当你检查,当它变得太小 –

+0

的消失来源,你会看到背景由三个'.svg'图片组成 – IiroP

回答

0

请看下面的代码。或者告诉我设置为背景颜色的颜色。

html { 
 
    -webkit-background-size: cover; 
 
    -moz-background-size: cover; 
 
    -o-background-size: cover; 
 
    background-size: cover; 
 
    height: 100%; 
 
    min-height: 100%; 
 
} 
 
body { 
 
    /*background-color: #f3f3f3;*/ 
 
    /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#87e0fd+0,d84953+40,05abe0+100 */ 
 
    background: rgb(135,224,253); /* Old browsers */ 
 
    background: -webkit-linear-gradient(left, rgba(135,224,253,1) 0%, rgba(216,73,83,1) 40%, rgba(5,171,224,1) 100%); 
 
    background: -moz-linear-gradient(left, rgba(135,224,253,1) 0%, rgba(216,73,83,1) 40%, rgba(5,171,224,1) 100%); 
 
    background: -o-linear-gradient(left, rgba(135,224,253,1) 0%, rgba(216,73,83,1) 40%, rgba(5,171,224,1) 100%); 
 
    background: linear-gradient(to right, rgba(135,224,253,1) 0%, rgba(216,73,83,1) 40%, rgba(5,171,224,1) 100%); /* FF3.6-15 */ /* Chrome10-25,Safari5.1-6 */ /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 
 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=1); /* IE6-9 */ 
 
}
<div style="border: 1px solid black; background-color: White; margin-top: 150px" class="container"> 
 
    test test 
 
</div>

+0

颜色是:#000099#9900CC和白色;但在你的例子中,颜色并不稳定,它们渐渐淡入对方,既没有多个方向,也没有多个方向 –

0

我以前repeating选项。下面是摘录:

html 
 
     { 
 
      -webkit-background-size: cover; 
 
      -moz-background-size: cover; 
 
      -o-background-size: cover; 
 
      background-size: cover; 
 
      height: 100%; 
 
      min-height: 100%; 
 
     } 
 
     body 
 
     { 
 
      background: -webkit-repeating-linear-gradient(45deg, 
 
    #9900CC, 
 
    #9900CC 40%, 
 
    #000099 40%, 
 
    #000099 80%); 
 
     }
<div style="border: 1px solid black; background-color: White; margin-top: 150px" 
 
     class="container"> 
 
     
 
     test test 
 
    </div>

+0

感谢您的回复,但这是一个方向,我的问题是针对多个方向的,这可能吗? –