CSS 径向渐变

CSS 径向渐变

A radial gradient is defined by its center.

To create a radial gradient you must also define at least two color stops.

句法

background-image: radial-gradient(shape sizeatposition, start-color, ..., last-color);

By default, shape is ellipse, size is farthest-corner, and position is center.

Radial Gradient - Evenly Spaced Color Stops (this is default)

The following example shows a radial gradient with evenly spaced color stops:

例子

#grad {

background-image: radial-gradient(red, yellow, green);

}

来试试吧 »

Radial Gradient - Differently Spaced Color Stops

The following example shows a radial gradient with differently spaced color stops:

例子

#grad {

background-image: radial-gradient(red 5%, yellow 15%, green 60%);

}

来试试吧 »

Set Shape

The shape parameter defines the shape. It can take the value circle or ellipse. The default value is ellipse.

The following example shows a radial gradient with the shape of a circle:

例子

#grad {

background-image: radial-gradient(circle, red, yellow, green);

}

来试试吧 »

Use of Different Size Keywords

The size parameter defines the size of the gradient. It can take four values:

closest-side

farthest-side

closest-corner

farthest-corner

例子

A radial gradient with different size keywords:

#grad1 {

background-image: radial-gradient(closest-side at 60% 55%, red, yellow,

black);

}

#grad2 {

background-image: radial-gradient(farthest-side at 60%

55%, red, yellow, black);

}

来试试吧 »

Repeating a radial-gradient

The repeating-radial-gradient() function is used to repeat radial gradients:

例子

A repeating radial gradient:

#grad {

background-image:

repeating-radial-gradient(red, yellow 10%, green 15%);

}

来试试吧 »

CSS Gradient Properties

The following table lists the CSS gradient properties:

Property

描述

Sets one or more background images for an element

html css双色径向渐变,CSS 径向渐变相关推荐

  1. css 反色_使用CSS和JavaScript检测反色

    css 反色 There was something that bugged me after reading David's article on the invert filter last we ...

  2. CSS双色虚线边框,京东订单界面收货地址的下划线

    实现京东订单类似的下划线 .bottom_line {height: 10upx;background-image: linear-gradient(-45deg,#7ba9ff 0,#7ba9ff ...

  3. CSS 背景色 背景图片 渐变背景 - 径向渐变 background-image:radial-gradient()

    radial-gradient() 用来生成径向渐变的图片 基础语法 background-image: radial-gradient(shape extent at positionX posit ...

  4. php渐变背景颜色,css背景颜色渐变案例:线性渐变和径向渐变效果实例详解

    渐变是两种或多种颜色之间的平滑过渡.以前,必须使用图像来实现这些效果.但是,通过使用 CSS3 渐变(gradients),可以减少下载的事件和宽带的使用.此外,渐变效果的元素在放大时看起来效果更好, ...

  5. html背景色线性渐变,css中背景颜色线性渐变和径向渐变效果的示例分析

    css中背景颜色线性渐变和径向渐变效果的示例分析 发布时间:2021-06-04 14:00:26 来源:亿速云 阅读:80 作者:小新 这篇文章将为大家详细讲解有关css中背景颜色线性渐变和径向渐变 ...

  6. CSS线性渐变和径向渐变详解

    第九章:渐变色 1.线性渐变 1.1.什么是线性渐变 1.2线性渐变的写法 2.径向渐变 2.1什么是径向渐变 2.2径向渐变的写法 总结 1.线性渐变 1.1.什么是线性渐变 线性渐变,顾名思义就是 ...

  7. CSS 3种渐变效果(线性渐变,径向渐变,圆锥型渐变)

    1 linear-gradient(线性渐变) 1.1按方向渐变 语法: background: linear-gradient(direction, color-stop1, color-stop2 ...

  8. css新特性:线性渐变详解(重复性线性渐变、径向渐变、重复性径向渐变的使用)

    线性渐变 线性渐变 重复性线性渐变 径向渐变 重复性径向渐变的使用 线性渐变 线性渐变是向下.向上.向左.向右.对角方向的颜色渐变. 其语法格式为: background-image: linear- ...

  9. 【CSS】线性渐变、径向渐变

    文章目录 线性渐变 线性渐变 语法background-image:linear-gradient(方向,颜色1,颜色2-) 水平竖直方向 默认从上到下 to left 去到左边 从右往左 to ri ...

最新文章

  1. Android Studio 初体验
  2. 苹果手机4g网速慢怎么办_2020 年双十一建议学生党买 4G 苹果手机吗?
  3. dw java 编码_dW 编辑推荐:Java 8 习惯用语,第 4 部分:提倡使用有帮助的编码方式...
  4. Windows 10 关闭Hyper-V
  5. Java Timestamp Memo
  6. 前端学习(2383):vue编码规范
  7. pixel 6 root
  8. mk-parallel-dump 实验
  9. 用户节点cdn有什么用处
  10. 编程语言python怎么读-Python入门学习的计算机程序设计语言是怎样的?
  11. Git版本控制:Git高级教程
  12. 实习成长之路:面试官说的MySQL高可用-------主备一致到底是什么?
  13. iOS之某公司iOS开发笔试题
  14. mac配置OpenGL超级宝典(第7版)环境
  15. html 拖拽图片验证,JavaScript实现拖动滑块拼图验证功能(html5、canvas)
  16. ExtJs6中利用TreePicker实现下拉树
  17. 【5G NR】工作频段和信道安排
  18. 外汇EA之马丁格尔EA
  19. STM32单片机热敏打印自助排队叫号系统银行医院柜台DY-SV17F语音播报
  20. Hive 内置函数及自定义函数

热门文章

  1. 我感觉这是目前讲得最明白的线性回归的文章了
  2. 语音社交产品,安全合规“防坑指南”!
  3. 互联网1分钟 | 0114 ZEPETO中文版“崽崽”上线;好未来2B利器未来魔法校全面升级...
  4. 网易云信音视频技术落地提速,读书郎电话手表成行业先锋
  5. 今天,开源中国出了一条广告史上最“正直”的广告
  6. 并归排序(看别人的看不懂,自己写了一个),排序思想是一样的
  7. 报名 | 想在硅谷近距离接触蚂蚁金服的CTO和一众技术高管?这个机会一定不能错过!...
  8. Solr5.3.1通过copyField设置多个field(字段)同时检索
  9. 【计网】计算机网络期末总复习-谢希仁(个人总结)理论概念
  10. leetcode 遇到的问题