微信小程序学习笔记(8)--------样式基础

样式基础

一、样式的使用

wxml文件中编写view控件

wxss文件中编写样式内容微信小程序学习笔记(8)--------样式基础_第1张图片

class属性:使用哪个样式

二、样式的属性:

1、尺寸:width    hight  

 微信小程序学习笔记(8)--------样式基础_第2张图片

2、背景


3、边框

微信小程序学习笔记(8)--------样式基础_第3张图片

4、边距

margin:距离父view的距离

给image设上margin相当于设置上image与view的距离

Padding:image与它包裹的内容的距离

微信小程序学习笔记(8)--------样式基础_第4张图片

微信小程序学习笔记(8)--------样式基础_第5张图片微信小程序学习笔记(8)--------样式基础_第6张图片

微信小程序学习笔记(8)--------样式基础_第7张图片

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)



你可能感兴趣的:(微信小程序)