0502

1.css3媒体查询
媒体查询 做屏幕适配,pc,移动端
根据不同的设备显示不同的box
all所有设备
screen 屏幕设备 电脑 ipaid 手机
print 打印设备
not print 不包含打印设备
不加限制条件 所有的屏幕共有样式
写min-width 注意:从小到大去写
写max-width 注意:从大到小去写
内部样式写法

 @media screen and (min-width: 320px) {
                    .box{
                        width: 310px;
                    }
        }

外部样式写法

<link rel="stylesheet" href="./css/sc1.css" media="screen and (min-width:320px)"/>

2.css3选择器
ul>li:first-child{color: red;}
ul>li:last-child{color: blue;}
.box:before{content: “hello”;}content内容之前
.box:after{content: “world”;}content内容之后
ul>li:first-child~li{ color: #ffe249;} ~当前元素之后的所有同类型元素
ul>li:first-child+li{ color: #ffe249;}当前元素之后紧跟的元素
input[type^=t]{color: red; }type值以t开头
input[type$=t]{color: red; }type值以t结尾
input[type*=t]{color: red;}type值包含t
ul>li:first-of-type{border: 1px solid red; }选择当前元素子集里面li的第一个元素
ul>li:last-of-type{border: 1px solid red;}
ul>p:only-of-type{color: red;}找父元素里面仅有一个同类别标签
ul>li:nth-child(2){border: 1px solid red;}选择子元素括号里面写序号从前往后数第二个li
ul>li:nth-last-child(2){ border: 1px solid red; }从后往前数第二个li
:checked选择
::selection 选择
:disabled{border: 1px solid red;}不可用
:enabled{ border: 1px solid blue;}可用 可不可用只针对input框
ul>*:not§{ border: 1px solid red;}除去p

opacity: 0;完全透明
opacity: 1;完全不透明

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值