问答详情
源自:3-2 CSS3颜色 渐变色彩 

为啥径向效果不显示呢?

<!DOCTYPE html>

<html>

<head> 

<meta charset="utf-8">

<title>Gradient</title>

<style type="text/css">


p {

  width: 400px;

  height: 150px;

  line-height: 150px;

  text-align:center;

  color: #000;

  font-size:24px;

  background-image:radial-gradient(to top left,red,orange,yellow,green,blue,indigo,violet)

</style>

</head> 

<body>

  <p>右下角向左上角的线性渐变背景</p>

</body>

</html>


提问者:慕粉1420362554 2016-10-18 15:25

个回答

  • LonelyAscetic
    2016-10-18 15:58:17
    已采纳

    background-image:radial-gradient(to top left,red,orange,yellow,green,blue,indigo,violet)

    兄弟,径向就是圆形的啊,不用加方向了。不是线性渐变。。

  • 盯叮町玎仃
    2016-12-07 17:42:35

    background-image:radial-gradient(red,orange,yellow,green,blue,indigo,violet);

  • 我不是管家
    2016-10-19 10:04:56

     background-image:linear-gradient(to bottom right , red, orange,yellow,green,blue,indigo,violet);