flex-direction属性决定主轴的方向
- flex-direction: row; 主轴为水平方向,起点在左端。
- flex-direction: row-reverse;主轴为水平方向,起点在右端。
- flex-direction: column;主轴为垂直方向,起点在上沿。
- flex-direction: column-reverse;主轴为垂直方向,起点在下沿。
justify-content属性定义了项目在主轴上的对齐方式。
justify-content: flex-start | flex-end | center | space-between | space-around;两种居中对齐:
align-items: center; //水平
justify-content:center; //垂直.背景色从左到右渐变
background-image: linear-gradient(124deg,
#5db5f3 0%,
#5c8cef 100%),
linear-gradient(
#ffffff,
#ffffff);
background-blend-mode: normal,
normal;
- 重叠布局:
父组件
{
z-index: 10;
position:absolute;
top:0;
}
子组件:
{
position:fixed;
}
- 小程序button组件
- 设置透明,无边框,分享按钮
wxml:
<button open-type="share" class = "sharePage" plain ="true" style="border:none;" >分享</button>
wxss:
.sharePage{
position:fixed;
display:block;
margin-left:80%;
width: 100rpx;
height: 100rpx;
background-color:transparent;
}
上边框线
margin-top:20rpx;
border-top:10rpx solid #f2f1f8;居中布局
text-align:center;
flex-direction:column;
align-items:center;
display:flex;
- 背景图片平铺不重复设置
background-image:url();
background-repeat:no-repeat;
background-size:100% 100%;