- 尺寸: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{ 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)