小程序flex縱向布局,主軸屬性不起作用,justify-content:flex-start/flex-end/space-around; 都沒有用,是不是哪里搞錯了? 求教大家主軸為縱軸,justify-content:flex-start,按理說 子元素應(yīng)該是從 主軸開始位置 垂直方向從上到下排列的,預(yù)期的結(jié)果應(yīng)該是title元素 緊挨著頂部導(dǎo)航欄的如下圖,視圖元素總是無法從頂開始排列,總留下大片空白居中排列xml文件內(nèi)容如下:<view class="container" style=""> <view class="title" style="background: pink;">today</view> <view class="view-list" style="background: red;" wx:for="{{list}}" wx:key="*this"> <view id="{{index}}" class="item" bindtap="tapTitle"> <text style="">{{item.id}}</text> </view> </view></view>css內(nèi)容如下:.container{ background: yellow; display: flex; flex-direction: column; justify-content:flex-start;}.item{ padding: 5px; margin: 5px 20px; background: #f8f8f8; border: 1px solid #ccc; border-radius: 10px; display: flex; flex-direction: column; justify-content: center;}
小程序 CSS flex 縱向布局,主軸屬性不起作用?
大話西游666
2018-12-26 22:13:39