WeChat applet development-create a welcome page

Source: Internet
Author: User
Applet development-create a welcome page. in the previous article, we introduced the basic directory structure of the applet and the role of each file.
This article will create the first page with you. welcome to the page.

Let's take a look at the final: Below is the WXML code of the welcome page:

 
   
      
       
   
    
{UserInfo. nickName }}
     
    
      
   
    
Welcome to Applet development
     
  
 



The following is the WXSS code of the welcome page:

/**index.wxss**/.userinfo {  display: flex;  flex-direction: column;  align-items: center;}.userinfo-avatar {  width: 128rpx;  height: 128rpx;  margin: 20rpx;  border-radius: 50%;}.userinfo-nickname {  color: #aaa;}.userinfo image{  width: 200rpx;  height: 200rpx;  border-radius: 50%;}.usermotto {  margin-top: 200px;  border: 1px solid #405f80;  width: 250rpx;  height: 80rpx;  text-align: center;  border-radius: 5px;}.btn{  font-size: 22rpx;  font-family: MicroSoft Yahei;  font-weight: bold;  line-height: 80rpx;}page{  height: 100%;  background: #ECF8EB;}


Background color settings:

Note: In the most external view, setting the width and height of is invalid when adding background color. By default, a page exists.

Therefore, you need to write as follows:

page{  height: 100%;  background: #ECF8EB;}


Top settings:

The app. jason code is as follows:

{"Pages": ["pages/welcome"], "window": {"backgroundTextStyle": "light", "navigationBarBackgroundColor": "# ECF8EB ", "navigationBarTitleText": "Welcome", "navigationBarTextStyle": "black "}}


More small program development-create a welcome page related articles, please follow the PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.