zoukankan      html  css  js  c++  java
  • day03组件

    1、text   编写文本信息,等价于span

    2、view 等价于div

    3、image

    ============================wxml=======================
    <!--pages/index/index.wxml--> <view>实例一</view> <view class="menu1"> <image src="/pages/static/bird.jpg"></image> <image src="/pages/static/tiger.jpg"></image> <image src="/pages/static/flower.jpg"></image> <image src="/pages/static/horse.jpg"></image> </view> <view>实例二</view> <view class="menu2"> <view class="item"> <image src="/pages/static/bird.jpg"></image> <text>精品</text> </view> <view class="item"> <image src="/pages/static/tiger.jpg"></image> <text>精品</text> </view> <view class="item"> <image src="/pages/static/flower.jpg"></image> <text>精品</text> </view> <view class="item"> <image src="/pages/static/horse.jpg"></image> <text>精品</text> </view> </view>
    ======================xcss================================
    /* pages/index/index.wxss */
    .c1{
      color:red
    }
    image{
      width:100rpx;
      height:100rpx
    }
    .menu1{
      display: flex;
      flex-direction: row;
      justify-content: space-around;
    }
    .menu2{
      display: flex;
      flex-direction: row;
      justify-content: space-around;
    }
    .menu{
      display: flex;
      /*规定主轴的方向 row row-reverse也是行但是反向显示*/
      /*规定主轴的方向 column*/
      flex-direction: row;
      /*规定元素在主轴方向上的显示方式*/
      justify-content: space-around;
        /*规定元素在副轴方向上的显示方式
          align-items: ;
          一般副轴不用排
        */
    }

    .item{
       display: flex;
       flex-direction: column;
       align-items: center;
    }

    4、flex布局

    一种通用性的布局方式,记着4个布局样式就可以了

    display:flex    使用flex布局

    flex-direction :row/column  规定主轴的布局方式

    justify-content:flex-start/flex-end/space-around/space-between元素在主轴方向的布局

    align-items:flex-start/flex-end/space-around/space-between元素在副轴上的布局方式

    5、样式:

        px和rpx:

    在官网上,需要看的就是全局和组件

  • 相关阅读:
    设计模式(15)-命令模式
    设计模式(14)-模板方法模式
    设计模式(13)-代理模式
    设计模式(12)-享元模式
    设计模式(3)-工厂方法模式
    微服务(1)-简单初始化项目
    MCMC:Markov Chain&Monte Carlo(二)MH采样和Gibbs采样,MCMC局限性
    MCMC:Markov Chain& Monte Carlo(一)基本cdf采样,rejection采样,Importance采样
    指数族分布:相关概念理解
    matlab隐马尔可夫相关函数简单例子实现(help文档)
  • 原文地址:https://www.cnblogs.com/sunflying/p/13195699.html
Copyright © 2011-2022 走看看