CSS3新特性

html-css07

CSS3新特性,第1张

1、 [class~=flower]

选择 title 属性包含单词 "flower" 的所有元素。

2、 [class|=box]

选择 lang 属性值以 "box" 开头的所有元素。

3、 :focus

选择获得焦点的 input 元素。

4、 p::first-letter

选择每个 <p>元素的首字母。

5、 p:first-child

选择属于父元素的第一个子元素的每个 <p>元素。

6、 ::after ---- ::before

在每个 <p>元素的内容之前插入内容。-----在每个 <p>元素的内容之后插入内容。

7、 a[class^=red]

选择其 class 属性值以 "red" 开头的每个 <a>元素。

8、.box2 [class$=red]

选择其 class 属性以 "red" 结尾的所有 .box 2元素。

9、 a[src*="abc"]

选择其 src 属性中包含 "abc" 子串的每个 <a>元素。

10、.box3 h1:first-of-type

11、 tr:nth-child(2n+1)

选择属于其父元素的基数子元素的每个 <p>元素。

12、 :disabled

选择每个禁用的 <input>元素

chrome/safari : -webkit-

FF: -moz-

ie: -ms-

Opera: -o-

!!!!!!如何处理私有前缀:autoprefixer插件

1、 使用图标字体的原理

(1) 引入字体文件 *.ttf或其它

(2)在html文件中:定义字体

@font-face{

font-family: 'mzd'

src:'字体文件的地址'

}

(3)使用字体

.box {

font-family: 'mzd'

}

2、使用时的两种方案

(1)阿里巴巴图标字体

(2)font-awesome: 图标字体库

1、animation动画的使用方法

(1)先定义动画规则

(2)使用动画规则

2、animation的属性

CSS3新特性

1. animation:动画

2. transition:动画速度

3. transform:变形

4. 伪元素

5. 边框

border-radius 圆角边框

box-shadow  盒子阴影

border-image 边框背景123

背景

background-size 背景大小

background-origin 背景的起始点

background-clip  背景的覆盖范围

background-image  设置背景图片1234

文本

text-shadow 文本阴影

text-wrap   文本换行

@font-face  设置字体