小程序样式的属性

  • 尺寸:width、height、min-height等
  • 边框:border
  • 边距:margin、padding
  • 背景:background
  • 文本:color、font-*
  • 其他:表格、列表等

基本选择器:和css差不多算了不记了,其他的选择器也不说了。只记录伪类选择器。

伪类选择器:

  • 动态伪类选择器:(:link, :visited, :hover, :active, :focus):link, 链接样式   :visited,访问后     :hover,鼠标移动     这三个因为小程序里没有鼠标,所以不起作用。:active 点击会触发样式
    <view class='it'>
     点我
    </view>
    
    
    .it:active{
      width:100rpx;
      height: 100rpx;
     background-color: green;
    }
    
    
    点击多久样式维持多久

    :focus  获取焦点

  • 状态伪类选择器:(:enabled, :disabled, :checked)
  • 选择伪类选择器:(:first-child, :last-child, :nth-child(), :nth-last-child(),  :nth-of-type(), nth-last-of-type(), :first-of-type, :last-of-type, :only-child, :only-of-type)
  • 空内容伪类选择器:(:empty)
  • 否定伪类选择器:(:not)
  • 伪元素:(::first-line, ::first-letter, ::before, ::after, ::selection)

转载于:https://www.cnblogs.com/bneglect/p/11052852.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值