uniapp微信头像
<view class="circle">
<image src="../../static/images/shopping_list/header_1.jpg" mode=""></image>
</view>
一.css知识点
项目 | Value |
---|---|
border-radius: 50%; | 给元素添加圆角 (配合overflow使用) |
overflow: hidden; | 内容会被修剪,并且其余内容是不可见的 |
导image | 宽度和高度都要设置100% |
.circle{
border-radius: 50%;
overflow: hidden;
width: 100rpx;
height: 100rpx;
margin: auto;
}
.circle image{
width: 100%;
height: 100%;
}