uniapp WeChat avatar
<view class="circle">
<image src="../../static/images/shopping_list/header_1.jpg" mode=""></image>
</view>
1.css knowledge points
project | Value |
---|---|
border-radius: 50%; | Add rounded corners to elements (used with overflow) |
overflow: hidden; | The content is trimmed and the remaining content is invisible |
guide image | Both width and height must be set to 100% |
.circle{
border-radius: 50%;
overflow: hidden;
width: 100rpx;
height: 100rpx;
margin: auto;
}
.circle image{
width: 100%;
height: 100%;
}