css CSS GRADIENTS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css CSS GRADIENTS相关的知识,希望对你有一定的参考价值。

/*
GRADIENTS

LINEAR
background-image: linear-gradient(topcolor, bottomcolor);
background-image: linear-gradient(to top, bottomcolor, topcolor);
background-image: linear-gradient(to left, rightcolor, leftcolor);
background-image: linear-gradient(45deg, bottomleftcolor, toprightcolor);

RADIAL
background-image: radial-gradient(innercolor, outercolor); //elipse by default
background-image: radial-gradient(circle, innercolor, outercolor); //circle shape
background-image: radial-gradient(circle at top, innercolor, outercolor); //circle shape at top
background-image: radial-gradient(circle at top right, innercolor, outercolor); //circle shape at top right

GRADIENT COLOR STOPS
background-image: radial-gradient(circle at top right, firstcolor 0%, secondcolor 50%, thirdcolor 100%); //circle shape at top right (percentages are the default, only use if you want to change the default)

TRANSPARENTS GRADIENTS
Layer background images: separated by commas, first declared is topmost, last bottom-most.

Gradient from full color at top to full transparency at bottom:*/
  background:
    linear-gradient(#ffa949, transparent 90%), /*full orange color at top to 90% transpanency at bottom*/
    linear-gradient(to top, #fff, transparent), /*full white color at bottom to full transpanency at top*/
    #ffa949 url('../img/mountains.jpg') no-repeat center / cover;

以上是关于css CSS GRADIENTS的主要内容,如果未能解决你的问题,请参考以下文章

css CSS GRADIENTS

css CSS Text Gradients

CSS Css3 Gradients

CSS CSS3 Gradients所有浏览器

CSS3之渐变(Gradients)

css CSS:CSS3 Gradients模板来自http://www.hongkiat.com/blog/css-snippets-for-designers/