样式基础
一、样式的使用
wxml文件中编写view控件
wxss文件中编写样式内容
class属性:使用哪个样式
二、样式的属性:
1、尺寸:width hight
2、背景
3、边框
扫描二维码关注公众号,回复:
1431744 查看本文章
4、边距
margin:距离父view的距离
给image设上margin相当于设置上image与view的距离
Padding:image与它包裹的内容的距离
5、文本
6、其他(列表、内容、表格)
三、样式选择器
1、基本选择器
类选择器(.name{})
ID选择器(#name{})
元素选择器(name{})
包含选择器(p c{})所包含的所有的
2、属性选择器
E[attr]
E[attr=”value”]
E[attr~=”value”]
E[attr|=”value”]
E[attr^=”value”]
E[attr$=”value”]
E[attr*=”value”]
3、伪类选择器
动态伪类选择器(/*:link ,:visited,:hover,*/:active,:focus)
状态伪类选择器(:enable,:disable,: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)