CSS3新增的属性

CSS3新增的属性

前缀: -webkit- :safari 和 Chrome的兼容
-o- :opera的兼容

1、:hover

img{
				border-radius: 50%;
				transform: all 0.5s;
			}
			img:hover{
				transform: scale(1.1);
			}
<div>
			<img src="img/pic4.jpg"/>
		</div>

结果为:
在这里插入图片描述

当鼠标hover的时候,图片放大1.1倍,鼠标移出时就以0.5秒的速度缩小到最初的样式

文章首字下沉效果:
1、::first-line

p::first-line {
            /* 第一行 */
            color: #f0f;
            font-weight: bold;
        }

结果为:
效果图

2、::first-letter

		p::first-letter {
            /* 第一个字 */
            font-size: 40px;
            color: red;
            float: left;
      	  }

效果图

3、::selection(文章选中)

p span::selection {
            /* background-color: ;
            color: ;
            text-shadow: ; */
            background-color: aqua;
            color: red;
        }

在一个段落里面,选中后显示是样式

选中后的样式
4、:not(class 或 id属性):表示除此以外的
5、:nth-child(odd):表示单数行 的样式
6、:nth-child(even):表示双数行当样式
7、::after / ::befor (表示在元素前/后添加)
注意:after:必须搭配 content: ’ ';使用,即使不写可为空
8、:empty(空选择器)
9、:root (根选择器)
10、:nth-child(2n-1)
11、:nth-last-child(2)
12、:nth-last-of-type(2)

13、input框的

  • ::placeholder
  • :checked
  • :disabled (不可用)
  • :read-only
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值