css3实现条纹以及方格斜纹背景

CSS代码:
.stripes {
height: 250px;
width: 375px;
float: left; margin: 10px; -webkit-background-size: 50px 50px;
-moz-background-size: 50px 50px;
background-size: 50px 50px; /* 控制条纹的大小 */ -moz-box-shadow: 1px 1px 8px gray;
-webkit-box-shadow: 1px 1px 8px gray;
box-shadow: 1px 1px 8px gray;
} .horizontal {
background-color: #0ae;
background-image: -webkit-gradient(linear, , %, color-stop(., rgba(, , , .)), color-stop(., transparent), to(transparent));
background-image: -moz-linear-gradient(rgba(, , , .) %, transparent %, transparent);
background-image: -o-linear-gradient(rgba(, , , .) %, transparent %, transparent);
background-image: linear-gradient(rgba(, , , .) %, transparent %, transparent);
} .vertical {
background-color: #f90;
background-image: -webkit-gradient(linear, , % , color-stop(., rgba(, , , .)), color-stop(., transparent), to(transparent));
background-image: -moz-linear-gradient(0deg, rgba(, , , .) %, transparent %, transparent);
background-image: -o-linear-gradient(0deg, rgba(, , , .) %, transparent %, transparent);
background-image: linear-gradient(0deg, rgba(, , , .) %, transparent %, transparent);
} .picnic {
background-color:white;
background-image: -webkit-gradient(linear, , %, color-stop(., transparent), color-stop(., rgba(, , , .)), to(rgba(, , , .))),
-webkit-gradient(linear, , % , color-stop(., transparent), color-stop(., rgba(, , , .)), to(rgba(, , , .)));
background-image: -moz-linear-gradient(transparent %, rgba(, , , .) %, rgba(, , , .)),
-moz-linear-gradient(0deg, transparent %, rgba(, , , .) %, rgba(, , , .));
background-image: -o-linear-gradient(transparent %, rgba(, , , .) %, rgba(, , , .)),
-o-linear-gradient(0deg, transparent %, rgba(, , , .) %, rgba(, , , .));
background-image: linear-gradient(transparent %, rgba(, , , .) %, rgba(, , , .)),
linear-gradient(0deg, transparent %, rgba(, , , .) %, rgba(, , , .));
} .angled {
background-color: #ac0;
background-image: -webkit-gradient(linear, %, % ,
color-stop(., rgba(, , , .)), color-stop(., transparent),
color-stop(., transparent), color-stop(., rgba(, , , .)),
color-stop(., rgba(, , , .)), color-stop(., transparent),
to(transparent));
background-image: -moz-linear-gradient(45deg, rgba(, , , .) %, transparent %,
transparent %, rgba(, , , .) %, rgba(, , , .) %,
transparent %, transparent);
background-image: -o-linear-gradient(45deg, rgba(, , , .) %, transparent %,
transparent %, rgba(, , , .) %, rgba(, , , .) %,
transparent %, transparent);
background-image: linear-gradient(45deg, rgba(, , , .) %, transparent %,
transparent %, rgba(, , , .) %, rgba(, , , .) %,
transparent %, transparent);
} .angled- {
background-color: #c16;
background-image: -webkit-gradient(linear, , % %,
color-stop(., rgba(, , , .)), color-stop(., transparent),
color-stop(., transparent), color-stop(., rgba(, , , .)),
color-stop(., rgba(, , , .)), color-stop(., transparent),
to(transparent));
background-image: -moz-linear-gradient(-45deg, rgba(, , , .) %, transparent %,
transparent %, rgba(, , , .) %, rgba(, , , .) %,
transparent %, transparent);
background-image: -o-linear-gradient(-45deg, rgba(, , , .) %, transparent %,
transparent %, rgba(, , , .) %, rgba(, , , .) %,
transparent %, transparent);
background-image: linear-gradient(-45deg, rgba(, , , .) %, transparent %,
transparent %, rgba(, , , .) %, rgba(, , , .) %,
transparent %, transparent);
} .checkered {
background-image: -webkit-gradient(linear, , % %, color-stop(., #), color-stop(., transparent), to(transparent)),
-webkit-gradient(linear, %, % , color-stop(., #), color-stop(., transparent), to(transparent)),
-webkit-gradient(linear, , % %, color-stop(., transparent), color-stop(., #)),
-webkit-gradient(linear, %, % , color-stop(., transparent), color-stop(., #));
background-image: -moz-linear-gradient(45deg, # %, transparent %, transparent),
-moz-linear-gradient(-45deg, # %, transparent %, transparent),
-moz-linear-gradient(45deg, transparent %, # %),
-moz-linear-gradient(-45deg, transparent %, # %);
background-image: -o-linear-gradient(45deg, # %, transparent %, transparent),
-o-linear-gradient(-45deg, # %, transparent %, transparent),
-o-linear-gradient(45deg, transparent %, # %),
-o-linear-gradient(-45deg, transparent %, # %);
background-image: linear-gradient(45deg, # %, transparent %, transparent),
linear-gradient(-45deg, # %, transparent %, transparent),
linear-gradient(45deg, transparent %, # %),
linear-gradient(-45deg, transparent %, # %);
}
HTML代码:
<div class="horizontal stripes"></div>
<div class="vertical stripes"></div>
<div class="picnic stripes"></div>
<div class="angled stripes"></div>
<div class="angled-135 stripes"></div>
<div class="checkered stripes"></div>
来源:https://www.zhangxinxu.com/study/201104/css3-strips-patterns-no-image.html
css3实现条纹以及方格斜纹背景的更多相关文章
- css条纹背景样式、及方格斜纹背景的实现
一.横向条纹如下代码: background: linear-gradient(#fb3 %, #58a %) 上面代码表示整个图片的上部分20%和下部分20%是对应的纯色,只有中间的部分是渐变色.如 ...
- css3实现条纹背景
<!DOCTYPE HTML><html><head><meta charset='utf-8'/><meta forua="true& ...
- 纯css3棋盘图案背景以及45度斜纹背景
css代码 .stripes { height: 250px; width: 375px; float: left; margin: 10px; ...
- CSS3随内容自动伸缩的背景【转】
CSS3给我们带来一个非常实用的新属性:border-image,利用这个属性我们可以做出随着内容的增减自动伸缩的背景.废话不多说,看代码!HTML:<ol> <li>第一条列 ...
- CSS3随内容自动伸缩的背景
CSS3给我们带来一个非常实用的新属性:border-image,利用这个属性我们可以做出随着内容的增减自动伸缩的背景.废话不多说,看代码! HTML: <ol> <li>第一 ...
- CSS3动画设置后台登录页背景切换图片
CSS3的动画很实用很好用,简单几句话就可以做出一个好看而且过渡平滑的body背景图片,不多说,来来来,上代码 body{ animation:mybg 7s; -webkit-animation:m ...
- css3动画,点击圆形背景扩展整个页面效果
上次做项目的时候,要求点击链接,这个链接的圆形背景扩散充满整个页面,今天把这个效果整理一下,是简单的css3的动画特效,粘贴下面的代码看效果 <!DOCTYPE html> <htm ...
- CSS3做出条纹大背景
㈠实现不等宽背景条纹 实现如上图所示的效果,代码如下: <!DOCTYPE html> <html lang="en"> <head> &l ...
- css3基础-选择器+边框与圆角+背景与渐变
Css3选择器相关: section > div直接子元素选择器 div + article相邻兄弟选择器(在元素之后出现) div ~ article通用兄弟选择器(在元素之后出现) 属性选择 ...
随机推荐
- easyui 面板title 加东西
- slice,substring,substr的区别
1.都为正整数//例子数据 var arr = [1,2,3,4,5,6,7], var str = "helloworld!"; //注意这里有个!号也算一位若有空格,空格也算一 ...
- Tomcat并发优化和缓存优化
Tomcat并发优化 1.调整连接器connector的并发处理能力 在Tomcat 配置文件 server.xml 中的 <Connector ... /> 配置中 1.参数说明 max ...
- 第二天:python的函 数、循环和条件、类
https://uqer.io/community/share/54c8af17f9f06c276f651a54 第一天学习了Python的基本操作,以及几种主要的容器类型,今天学习python的函数 ...
- Redis-安装篇
Redis Cluster搭建 需求:创建6个节点,3主3从127.0.0.1:6379127.0.0.1:6380127.0.0.1:6381127.0.0.1:6382127.0.0.1:6383 ...
- ES6 中 Promise
在说Promise之前我们先简单说一下什么是同步异步? 同步(Sync):所谓同步,就是发出一个功能调用时,在没有得到结果之前,该调用就不返回或继续执行后续操作. 异步(Async):异步与同步相对, ...
- 查看python内部模块命令,内置函数,查看python已经安装的模块命令
查看python内部模块命令,内置函数,查看python已经安装的模块命令 可以用dir(modules) 或者用 pip list或者用 help('modules') 或者用 python -m ...
- unity解压缩zip发布后的一些问题
前段时间项目需要,搞了下zip的解压缩问题,也是利用ICSharpCode.SharpZipLib.dll来处理的zip,这里说下之前遇到的坑(这里提供我用的这个库ICSharpCode.SharpZ ...
- JSP学习(2)---四种基本语法与三种编译指令
JSP的异常可以不处理,即使是checked异常. 四种基本语法: jsp声明,jsp注释,jsp表达式,jsp脚本 三种编译指令: page,include,taglib 下面是具体的练习. sho ...
- django之信号
Django中提供了“信号调度”,用于在框架执行操作时解耦.通俗来讲,就是一些动作发生的时候,信号允许特定的发送者去提醒一些接受者. 1.Django内置信号 Model signals pr ...