前面文章介绍了flex布局,以及使用flex布局制作色子效果,本文将介绍微信小程序实战实现名片布局设计。
话不多说,直接上代码。
(1)index.wxml文件,代码如下:
<view class="outLayer"><view class="company">xx技术服务有限公司</view><View class="name"><View class="nameDes"><View class="whiteDes">bussiness affairs</View></View><View class="nameDe">鲍某</View></View><view class="job"><view class="jobItem">项目老大</view></view><View class="contact"><view class="cotactContent"><View class="line"></View><View class="contactDetail"><View>公司地址:武汉市藏龙岛</View><View>公司电话:0000000000000</View><View>个人手机:1000000000000</View><View>个人邮箱:10000000@163</View></View> </view></View>
</view>
(2)index.wxss文件,代码如下:
.outLayer{margin:50rpx;height: 400rpx;display:flex;flex-direction: column;background: white;border: 3rpx solid lightgrey;border-bottom: 15rpx solid lightgrey;
}pany{font-size: 25rpx;margin: 15rpx;text-align: end;
}.name{margin-top: 30rpx;height: 40rpx;display: flex;flex-direction: row;justify-content: flex-start;
}.nameDes{display: flex;flex-direction: row;width: 50%;height: 60rpx;background-color: black;justify-content: space-around;align-items: center;
}.whiteDes{color: white;font-size: xx-small;font-style: oblique;
}.nameDe{width: 50%;height: 30rpx;font-size: 40rpx;text-align: center;
}.job{margin-top: 20rpx;width: 100%;display: flex;flex-direction: row;justify-content: flex-end;
}.jobItem{width: 50%;display: flex;flex-direction: row;justify-content: center;font-size: x-small;
}.contact{margin-top: 60rpx;width: 100%;height:120rpx;display: flex;flex-direction: row;justify-content: flex-end;
}.cotactContent{width: 50%;height: 100%;display: flex;flex-direction: row;
}.line{width: 3rpx;height: 100%;background-color: black;
}.contactDetail{margin-left: 10rpx;display: flex;flex-direction: column;font-size: 18rpx;font-family: Verdana, Geneva, Tahoma, sans-serif;justify-content: space-around;
}
运行结果如下:
本文介绍了微信小程序如何实战实现名片布局设计,有兴趣的同学可以进一步深入研究。
本文发布于:2024-02-04 06:13:41,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170700780552995.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |