微信小程序————样式

                                 微信小程序————样式

一、基本选择器

 

  1. 类选择器:

    在微信小程序中,****.wxml文件中编写代码时使用。

.it3{
background-color: blue;
border: 1px solid white;
display:flex;
justify-content: center;
}

   2.ID选择器 

#testId{
background-color: blue;
border: 1px solid white;
display:flex;
justify-content: center;
}

3.元素选择器 

eg:下面这个样式,就可以用于 本页面样式的 所有的 image标签

image{
border: 120px solid #aaa;
}

 

4.包含关系

 

 

.usermotto text{
color: red;
}

 

二、属性选择器(现在微信小程序用不了)

 

三、动态伪类选择器

       :link,:visited,:hover 暂时在微信小程序上不支持

  1. :active 点击时触发的效果。
/*点击前*/
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}

/*点击后*/
.userinfo-avatar:active {
width: 28rpx;
height: 28rpx;
margin: 20rpx;
border-radius: 5%;
}

2.:focus

多用于输入框 聚焦的时候

 

 

 

 

 

 

 

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值