1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "Utf-8">5 <title></title>6 <Linkrel= "stylesheet"type= "Text/css"href= "Style.css">7 </Head>8 <Body>9 <DivID= "Div1"></Div>Ten <DivID= "Div2"></Div> One </Body> A </HTML>
1 Div{2 width:300px;3 Height:200px;4 Border:Solid;5}6 #div1{7 /*background-image:linear-gradient (red,blue);*//*default from top to bottom*/8 /*background-image:linear-gradient (0deg,red,blue);*//*0deg from bottom to top*/9 /*background-image:linear-gradient (to Right,red,blue);*/Ten /*background-image:linear-gradient (to Left,red,blue);*/ One /*background-image:linear-gradient (to right bottom,red,blue);*/ A /*background-image:linear-gradient (to Right,red,green,blue);*/ - /*background-image:linear-gradient (to right top,red 25%,green 50%,orange 75%,blue 100%);*/ - /*background-image:linear-gradient (to right top,red 0px,green 100px,orange 200px,blue 300px);*/ the Background-image:repeating-linear-gradient (to right top,red 0px,green 10px,orange 20px,blue 30px);/*start repeating gradient settings after 30px*/ -} - #div2{ - /*background-image:radial-gradient (red,blue);*//*default from inside to outside*/ + /*background-image:radial-gradient (circle,red,green,blue);*//*default ellipse ellipse, can be set Circle circle*/ - /*Background-image:radial-gradient (circle at Right,red,green,blue);*/ + /*Background-image:radial-gradient (circle at left Bottom,red,green,blue);*/ A /*background-image:radial-gradient (Circle 50px,red,green,blue);*//*50px for Radius*/ at /*background-image:radial-gradient (Circle farthest-corner,red,green,blue);*//*The radius, in addition to pixels such as 50px, can also use keywords closest-side the center of the circle to the nearest edge, the Farthest-side center to the farthest edge, the Closest-corner center to the nearest corner, Farthest-corner the center of the distance to the farthest corner*/ - Background-image:repeating-radial-gradient (Circle Closest-side,red,green,blue); -}
"CSS3" gradient