zoukankan      html  css  js  c++  java
  • 微信小程序 view 中 文本换行居中实现

     1       <view class="box">  
     2         <!-- box 中装所有右面的东西  -->
     3         <view class="inner_box"> 
     4           <!-- 一个inner_box 是一个大类  -->
     5           <view class="label">历年真题高频词背诵<view class="lf_line"></view><view class="rt_line"></view> </view>
     6           <view class="item_box" >
     7             <!-- 一个item_box 中最多放两个  -->
     8             <view class="item"><view>100个句子搞定考研单词</view></view>
     9             <view class="space"></view>
    10             <!-- space为中间隔层 不能少 -->
    11             <view class="item"><view>100个句子搞定考研单词</view></view>
    12           </view>
    13 
    14           <view class="item_box" >
    15             <!-- 一个item_box 中最多放两个  -->
    16             <view class="item"><view>100个句子</view></view>
    17             <view class="space"></view>
    18             <!-- space为中间隔层 不能少 -->
    19             <view class="item"><view>考研单词</view></view>
    20           </view>
    21 
    22         </view>
    23 
    24 
    25       </view>
    index.wxml
     1 .box .item_box{
     2   display: flex;
     3   margin: 20rpx 0;
     4 
     5 }
     6 .box .item_box .item{
     7   width: 45%;
     8   height: 100rpx;
     9   /* background-color: #FAFAFA; */
    10   background-color: red;
    11   display: flex;
    12   /* 下面两行保证 里面的句子 居中 重要!!! */
    13   justify-content: center;
    14   align-items: center;
    15 }
    16 .box .item_box .item view{
    17   text-align: center;
    18 }
    19 .box .item_box .space{
    20   width: 10%;
    21 }
    index.wxss
  • 相关阅读:
    POJ 2892 Tunnel Warfare(树状数组+二分)
    POJ 2886 Who Gets the Most Candies?(树状数组+二分)
    POJ 2492 A Bug's Life(并查集)
    POJ 1182 食物链(并查集)
    POJ 1703 Find them, Catch them(种类并查集)
    TC SRM 582 DIV 2
    函数
    shell进阶--流程
    计划任务 at,cron
    kill命令
  • 原文地址:https://www.cnblogs.com/zach0812/p/12310049.html
Copyright © 2011-2022 走看看