微信小程序欢迎页面效果实现

在这里插入图片描述

welcome.wxml

<view class="container">
  <image class="avatar" src="/images/avatar/1.png"></image>
  <text class="motto">Hello, 微信</text>
  <view class="journey-container" bindtap="onTap">
    <text class="journey">开启小程序之旅</text>
  </view>
</view>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #b3d4db;
}

.avatar {
  width: 200rpx;
  height: 200rpx;
  margin-top: 160rpx;
}

.motto {
  margin-top: 100rpx;
  font-size: 32rpx;
  font-weight: bold;
}

.journey-container {
  margin-top: 200rpx;
  border: 1px solid #405f80;
  width: 200rpx;
  height: 80rpx;
  border-radius: 5px;
  text-align: center;
}

.journey {
  font-size: 22rpx;
  font-weight: bold;
  line-height: 80rpx;
  color: #405f80;
}

此时查看效果:
在这里插入图片描述
虽然在设置了container的background-color,但是并没有铺满整个屏幕,导航栏和底部都没有被设置颜色。
在这里插入图片描述

可以在welcome.json中设置导航栏的颜色

"navigationBarBackgroundColor": "#b3d4db"

可以在welcome.wxss中设置page样式,使颜色铺满整个屏幕

page {
  height: 100%;
  background-color: #b3d4db;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值