网站首页 > 技术文章 正文
平台ID:WEB_wysj(点击关注) ◎ ◎ ◎ ◎ ◎◎◎◎◎一┳═┻︻▄
(页底留言开放,欢迎来吐槽)
● ● ●
先总结一篇简略版CSS3知识清单。
1、前缀
-webkit-(chrome和Safari)、-moz-(firefox)、-ms-(IE)、-o-(opera)
2、边框
圆角:border-radius: 5px 4px 3px 2px; /* 顺时针 */
阴影:box-shadow: X轴偏移量 Y轴偏移量
[阴影模糊半径] [阴影扩展半径] [阴影颜色] [投影方式];
/* 默认外阴影*/外阴影 :box-shadow:4px 2px 6px #333333;
内阴影: box-shadow:4px 2px 6px #333333 inset;
多阴影: box-shadow:4px 2px 6px #f00, -4px -2px 6px #000, 0px 0px 12px 5px #33CC00 inset;
边界图片:border-image: 图片路径 像素顺时针 延伸方式(repeat重复
round平铺 stretch 拉伸) border-image:url(border.png) 30 30 round; -webkit-border-image:url(border.png) 30 30 round; /* Safari 5 and older */ -o-border-image:url(border.png) 30 30 round; /* Opera */
3、背景 background
大小: background-size: auto | <长度值> | <百分比> | cover | contain 原点: background-origin : border-box | padding-box | content-box;
裁剪: background-clip : border-box | padding-box | content-box | no-clip 多重背景: background : [background-color] | [background-image] |
[background-position][/background-size] | [background-repeat] |
[background-attachment] | [background-clip] | [background-origin],...
【例】background:url(logoindex.png) no-repeat left top/75% 50% , url(logoindex.png) no-repeat right bottom/50% 45%;
4、渐变
线性渐变: //默认从上到下、可以改变方向和角度
background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */ background: linear-gradient(red, blue); /* 标准的语法 */
径向渐变: background: -webkit-radial-gradient(red, green, blue); /* Safari 5.1 - 6.0 */ background: -o-radial-gradient(red, green, blue); /* Opera 11.6 - 12.0 */ background: -moz-radial-gradient(red, green, blue); /* Firefox 3.6 - 15 */ background: radial-gradient(red, green, blue); /* 标准的语法 */
5、文本效果
阴影:text-shadow:X偏移 Y偏移 模糊程度 阴影颜色; text-shadow: 5px 5px 5px #FF0000;文本溢出:text-overflow:ellipsis; overflow:hidden; white-space:nowrap;
6、字体
@font-face { font-family : 字体名称; src : 字体文件在服务器上的相对或绝对路径;}
调用:font-family: 字体名称;
7、2D变形 (transform: 带前缀-ms- -webkit-)
8、3D变形
位移:translate3d(x,y,z)、translateZ(z)缩放:scale3d(x,y,z)、scaleZ(z)旋转:rotate3d(x,y,z,angle)、rotateZ(angle)
9、过渡 (transition: 带前缀-webkit-)
10、动画 (-webikt-)
【例】@keyframes myfirst、@-webkit-keyframes myfirst div{ animation: myfirst 5s linear 2s infinite alternate; -webkit-animation: myfirst 5s linear 2s infinite alternate;}
11、多列布局
多列布局 columns:(column-width) || (column-count); column-width: auto | (length); column-count:auto | (integer);列间距 column-gap: normal || (length)列表边框 column-rule:(column-rule-width)|(column-rule-style)|(column-rule-color)跨列设置 column-span: none | all
12、CSS3外轮廓属性
outline: [outline-color] || [outline-style] || [outline-width] || [outline-offset] || inherit
outline:2px solid red;outline-offset:15px;
13、盒子模型
box-sizing: content-box | border-box | inherit
14、自由缩放属性
resize:none | both | horizontal | vertical | inherit
列出CSS2和css3知识清单,接下来就是总结CSS实用技巧了。
干货!免费领取腾讯高级讲师网页设计教程
点我领取
点击下方“阅读原文”结交更多有才华的设计师!
↓↓↓
猜你喜欢
- 2025-07-10 手把手教你H5实现工厂游戏的CSS动画效果「实践」
- 2025-07-10 居然可以通过动画快速学习 css(用css实现动画)
- 2025-07-10 前端开发-CSS3动画实现焦点(图文轮播)图效果
- 2025-07-10 用C++ Qt手把手打造炫酷汽车仪表盘
- 2025-07-10 css零基础自学教程(十五)css3过渡与转换
- 2025-07-10 你重温《真爱至上》了吗?(真爱至上百科)
- 2025-07-10 分享CodePen上6个酷炫demo特效(code vein demo)
- 2025-07-10 告别setTimeout:7种更高效更可靠的JavaScript定时任务解决方案
- 2025-07-10 取代JavaScript库的10个现代Web API及详细实施代码
- 2025-07-10 UI样式iPod classic的HTML本地音乐播放器框架
- 最近发表
-
- Qt编程进阶(63):Qt Quick高级控件的使用
- Qt编程进阶(47):QML鼠标事件处理(qt编程难不难)
- 使用Xamarin和Visual Studio开发Android可穿戴设备应用
- Qt使用教程:创建Qt Quick应用程序(三)
- QML性能优化 | 常见界面元素优化(qml布局自适应大小)
- Qt使用教程:创建移动应用程序(二)
- Qt Quick 多媒体开发播放音乐和视频
- Qt使用教程:创建Qt Quick UI表单(三)
- 如何将 Qt 3D 渲染与 Qt Quick 2D 元素结合创建太阳系行星元素?
- QML控件:TextInput, TextField, TextEdit, TextArea用法及自定义
- 标签列表
-
- axure 注册码 (25)
- exploit db (21)
- mutex_lock (30)
- oracleclient (27)
- nfs (25)
- springbatch (28)
- oracle数据库备份 (25)
- dir (26)
- connectionstring属性尚未初始化 (23)
- output (32)
- panel滚动条 (28)
- centos 5 4 (23)
- sql学习 (33)
- c 数组 (33)
- pascal语言教程 (23)
- ppt 教程 (35)
- java7 (24)
- 自适应网站制作 (32)
- server服务自动停止 (25)
- 超链接去掉下划线 (34)
- 什么是堆栈 (22)
- map entry (25)
- ubuntu装qq (25)
- outputstreamwriter (26)
- fill_parent (22)