《样式设计006:展示类的样式》

描述:在开发小程序过程中,发现一些不错的案例,平时使用也比较多,稍微总结了下经验,以下内容可以直接复制使用,希望对大家有所帮助,废话不多说直接上干货!


 

一、展示类的样式

(一)样式图

展示效果样式图

(二)代码部分

2.1:wxml样式代码:

<!-- index.wxml -->
<view class="container">
  <image class="header-image" src="https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF"></image>
  <text class="title">欢迎来到我们的小程序</text>
  <view class="description">
    <text>这是一个展示类小程序的样例</text>
  </view>
  <view class="feature-list">
    <view class="feature-item">
      <image src="https://t7.baidu.com/it/u=1831997705,836992814&fm=193&f=GIF"></image>
      <text>功能介绍1</text>
    </view>
    <view class="feature-item">
      <image src="https://t7.baidu.com/it/u=2582370511,530426427&fm=193&f=GIF"></image>
      <text>功能介绍2</text>
    </view>
  </view>
</view>

2.2:wxss样式代码

/* index.wxss */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20rpx;
}

.header-image {
  width: 100%;
  height: 200rpx;
  object-fit: cover;
  border-radius: 10rpx;
  margin-bottom: 20rpx;
}

.title {
  font-size: 24rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 10rpx;
}

.description {
  text-align: center;
  color: #666;
  margin-bottom: 20rpx;
}

.feature-list {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

.feature-item {
  text-align: center;
}

.feature-item image {
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
  margin-bottom: 10rpx;
}

.feature-item text {
  font-size: 14rpx;
  color: #666;
}

  • 7
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大大大钢琴

开启一个愿望池,许下你愿望吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值