小程序问题总结1

1.进行横向平分长度

 display: flex;
 flex: 1;

2.水平方向居中

  align-items: center;
  justify-content: center;

3.设置长宽后将多余的部分不显示

overflow: hidden;

4.设置grid列表显示,使用浮动

float: left;

5.不同的view进行覆盖,使用定位
在最外层的view中使用相对定位

position: relative;

在里面的view中使用绝对定位

 left: 20rpx;
 top: 20rpx;
 position: absolute;

6.可以使用css选择器

.brand-item image:nth-child(2n+1) {
  left: 1rpx;
}

.topic-item:first-child {
  margin-left: 30rpx;
}

7.文字的单行显示

  white-space: nowrap;

8.使用scrollview的时候的注意事项
https://www.cnblogs.com/miu-key/p/7606024.html

猜你喜欢

转载自blog.csdn.net/yuezheyue123/article/details/86512353