FCC—Create a Gradual CSS Linear Gradient_白江_前端开发者

Applied Visual Design: Create a Gradual css Linear Gradient

background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...)

background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...)background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...)

 
The first argument specifies the direction from which color transition starts – it can be stated as a degree, where 90deg makes a vertical gradient and 45deg is angled like a backslash.

The first argument specifies the direction from which color transition starts – it can be stated as a degree, where 90deg makes a vertical gradient and 45deg is angled like a backslash.

The following arguments specify the order of colors used in the gradient.

The following arguments specify the order of colors used in the gradient.

 
Example:

Example:

background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));

 

练习代码如下:

background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));

 

练习代码如下:

<style>
  div {
    border-radius: 20px;
    width: 70%;
    height: 400px;
    margin: 50px auto;
    background: linear-gradient(35deg, #ccffff, #ffcccc);
  }
</style>
<div></div>

 

<style>
  div {
    border-radius: 20px;
    width: 70%;
    height: 400px;
    margin: 50px auto;
    background: linear-gradient(35deg, #ccffff, #ffcccc);
  }
</style>
<div></div>
<style>
  div {
    border-radius: 20px;
    width: 70%;
    height: 400px;
    margin: 50px auto;
    background: linear-gradient(35deg, #ccffff, #ffcccc);
  }
</style>
<div></div>


div {
border
radius: 20px;
width:
70;
height: 400px;
margin: 50px auto;
background: linear
gradient(35deg, #ccffff, #ffcccc);
}

 

效果如下:
 

 
» 本文来自:前端开发者 » 《FCC—Create a Gradual CSS Linear Gradient_白江_前端开发者》
» 本文链接地址:https://www.rokub.com/73810.html
» 您也可以订阅本站:https://www.rokub.com
赞(0)
64K

评论 抢沙发

评论前必须登录!