欢迎光临,了解微信小程序开发,就上易用通!

小程序样式的属性

发布:2021-06-19 18:06浏览: 来源:网络 作者:admin

  • 尺寸: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




免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。