css3之渐变背景色(linear-gradient)
2024-09-05 14:39:49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css3渐变背景色</title>
</head>
<!-- 背景颜色线性渐变【linear-gradient】
语法:
background:linear-gradient(起点,起点颜色,过度颜色【可选】,终点颜色);
起点:top是从上到下,left是从左到右。如果定义成left top,那就是从左上角到右下角
过渡色:可以插入多个,表示多种颜色的渐变
--> <style> .linear-gradient{
width: 1000px;
margin:0 auto;
text-align: center } .linear-gradient p{
width: 100px;
height: 100px;
float: left;
border:1px #999 solid;
line-height: 100px;
margin-right: 100px;
font-size:20px;
}
.linear-gradient p:first-child{
background:-webkit-linear-gradient(top,#09f,#fff,#0c0);
}
.linear-gradient p:last-child{
background:-webkit-linear-gradient(20deg,#09f,#fff,#0c0);
}
</style>
<body>
<div class="linear-gradient">
<p>普通渐变</p>
<p>角度渐变</p>
</div>
</body>
</html>
最新文章
- MySQL 主从复制
- Effective C++ 笔记1
- 三行代码接入,社交软件打字时底下弹出的表情布局,自定义ViewPager+页面点标+各种功能的android小框架。
- jquery-常用的运行函数
- Android studio .9图片造成的错误总结
- java多线程系类:基础篇:09之interrupt()和线程终止方式
- PreparedStatement解决sql注入问题
- @RequesParam注解源码解析
- JavaScript之arguments对象讲解
- 时间序列数据库武斗大会之 KairosDB 篇
- [压缩解压缩] SharpZip--压缩、解压缩帮助类
- 配置mysql允许远程连接
- Redis hash 类型及操作
- 什么是deferred对象
- Redis-09.慢查询
- (整理)SQL Server 2008 CDC 功能使用
- Performance面板看js加载
- 5分钟教你学会Django系统错误监控
- NestedScrollView嵌套ListView时只显示一行的解决方法
- [深入Maven源代码]maven绑定命令行参数到具体插件
热门文章
- 305. 岛屿数量 II
- Vue.js_devtools_5.1.0.zip【需要的可自行下载】
- css总结 -使用display:inline-block,出现元素高度错位
- 如何成为一名AI工程师
- data_analysis 第一课
- [USACO12FEB] 附近的牛 Nearby Cows - 树形dp,容斥
- Accept Xcode/iOS License to run git
- C++——字符串处理
- 题解 CF1064A 【Make a triangle!】
- 题解【AcWing271】杨老师的照相排列