
css
<template>
<view class="content">
<div class="imgdiv">
<img src="../../static/sousuo.png" alt="" />
<img src="../../static/jiahao.png" alt="" />
</div>
<div class="topdiv">
<h1>我的设备</h1>
<p>12个设备</p>
</div>
</view>
</template>
.content {
display: flex;
flex-direction: column;
width: 100%;
/* 确保容器占满宽度,否则靠右效果不明显 */
padding-right: 20rpx;
/* 可以加一点右边距,避免贴在最右侧 */
box-sizing: border-box;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
.content .imgdiv {
display: flex;
justify-content: flex-end;
/* 让整个 imgdiv 靠右 */
gap: 20rpx;
/* 两张图片之间的间距,比 margin-left 更方便 */
}
.imgdiv img {
height: 60rpx;
width: 60rpx;
margin-left: 20rpx;
}