微信小程序布局 左1右2(上下)布局设计,三个图片,左右布局

 

 

复制代码
  <view class="plate">
    <view class="plate-item plate-l">
      <view class="plate-l-l" bindtap="btn_course">
      <image src="{{_server_url}}img/01.png" class="plate-image1"></image>
      <text class="text1">告别失眠笔记</text>
      <text class="text2">夜夜安眠</text>
      </view>
    </view>
    <view class="plate-item plate-r">
      <view class="plate-r-t" bindtap="btn_course">
        <image src="{{_server_url}}img/02.png" class="plate-image2"></image>
        <text class="text1">致失眠</text>
        <text class="text2">朋友们的一封信</text>
      </view>
      <view class="plate-r-b" bindtap="btn_course">
        <image src="{{_server_url}}img/03.png" class="plate-image3"></image>
        <text class="text1">失眠</text>
        <text class="text2">调查问卷</text>
      </view>
    </view>
  </view>
复制代码

 

 

复制代码
/*  plate */
.plate{
  display: flex;
  flex-wrap: wrap;
  background-color: #fff;
  padding: 10px 10px 10px 10px;
  margin-bottom: 10px;
  margin-top: 10px;
}
.plate-item{
  width: 50%;
  display: flex;
  align-items:center;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.plate-l{

}
.plate-r{

}
.plate-l-l{
  width: 100%; 
  height: 367rpx;
  border-radius: 10px;
}
.plate-r-t{
  top: 0px;
  position: absolute;
  width: 100%;
  height: 50%;
}
.plate-r-b{
  bottom: 0px;
  position: absolute;
  width: 100%;
  height: 50%;
}
.plate-image1{
  width: calc(100% - 10px);
  height: 367rpx;
  border-radius: 10px;
}
.plate-image2{
  width: 100%;
  border-radius: 10px;
  height: calc(100% - 5px);
}
.plate-image3{
  width: 100%;
  border-radius: 10px;
  height: calc(100% - 5px);
  bottom: 0px;
  position: absolute;
}
.plate-item .text1{
  font-size: 18px;
  top: 16px;
  position: absolute;
  width: 100%;
  display: flex;
  font-weight: bold;
  left: 14px;
  color: #fff;
}
.plate-item .text2{
  font-size: 12px;
  top: 44px;
  position: absolute;
  width: 100%;
  display: flex;
  left: 14px;
  color: #fff;
}
复制代码

 

posted @   程序员一诺  阅读(2437)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示