微信小程序生日祝福代码
时间: 2023-10-01 11:08:55 浏览: 1043
以下是一个简单的微信小程序生日祝福代码示例:
WXML代码:
```
<view class="container">
<view class="birthday-card">
<image src="https://your-image-url.com/birthday.png"></image>
<text>祝你生日快乐!</text>
</view>
</view>
```
WXSS代码:
```
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.birthday-card {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0px 2px 10px rgba(0,0,0,0.1);
}
.birthday-card image {
width: 100%;
max-width: 300px;
margin-bottom: 10px;
}
.birthday-card text {
font-size: 20px;
color: #000;
text-align: center;
}
```
JS代码:
```
Page({
data: {},
onLoad: function () {}
})
```
这段代码将显示一个简单的生日祝福卡片,其中包含一个生日图片和一条文本信息。你可以根据需要自定义样式和内容。